How To Select All Columns of All Rows from a Table?
Page 1 of 1
How To Select All Columns of All Rows from a Table?
The simplest query statement is the one that selects all columns of all rows from a table:
"SELECT * FROM table_name;". The (*) in the SELECT clause tells the query to return all
columns. The tutorial exercise below gives you a good example:
SQL> SELECT * FROM departments;
DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
10 Administration 200 1700
20 Marketing 201 1800
30 Purchasing 114 1700
40 Human Resources 203 2400
50 Shipping 121 1500
60 IT 103 1400
70 Public Relations 204 2700
80 Sales 145 2500
90 Executive 100 1700
"SELECT * FROM table_name;". The (*) in the SELECT clause tells the query to return all
columns. The tutorial exercise below gives you a good example:
SQL> SELECT * FROM departments;
DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
10 Administration 200 1700
20 Marketing 201 1800
30 Purchasing 114 1700
40 Human Resources 203 2400
50 Shipping 121 1500
60 IT 103 1400
70 Public Relations 204 2700
80 Sales 145 2500
90 Executive 100 1700
Similar topics
» How To Select Some Columns from a Table?
» How To Select Some Rows from a Table?
» How To Create a New Table by Selecting Rows from Another Table?
» How To Create a New Table by Selecting Rows from Another Table?
» How To Use SELECT Statement to Count the Number of Rows?
» How To Select Some Rows from a Table?
» How To Create a New Table by Selecting Rows from Another Table?
» How To Create a New Table by Selecting Rows from Another Table?
» How To Use SELECT Statement to Count the Number of Rows?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Sun Jan 31, 2010 12:35 am by Micheal
» Accessing tables of other users in SQL
Sun Jan 31, 2010 12:34 am by Micheal
» Grouping commands in SQL
Sun Jan 31, 2010 12:32 am by Micheal
» Operations on Result Sets in SQL
Sun Jan 31, 2010 12:31 am by Micheal
» Subqueries in SQL
Sun Jan 31, 2010 12:30 am by Micheal
» Joining Relations in SQL
Sun Jan 31, 2010 12:28 am by Micheal
» Delete comand in SQL
Sun Jan 31, 2010 12:27 am by Micheal
» Update command in SQL
Sun Jan 31, 2010 12:26 am by Micheal
» Insert command in SQL
Sun Jan 31, 2010 12:23 am by Micheal