How To Select Some Columns from a Table?
Page 1 of 1
How To Select Some Columns from a Table?
If you want explicitly tell the query to some columns, you can specify the column names in
SELECT clause. The following select statement returns only two columns from the table
"departments":
SQL> SELECT location_id, department_name FROM DEPARTMENTS;
LOCATION_ID DEPARTMENT_NAME
----------- ------------------------------
1700 Administration
1800 Marketing
1700 Purchasing
2400 Human Resources
1500 Shipping
1400 IT
2700 Public Relations
2500 Sales
1700 Executive
SELECT clause. The following select statement returns only two columns from the table
"departments":
SQL> SELECT location_id, department_name FROM DEPARTMENTS;
LOCATION_ID DEPARTMENT_NAME
----------- ------------------------------
1700 Administration
1800 Marketing
1700 Purchasing
2400 Human Resources
1500 Shipping
1400 IT
2700 Public Relations
2500 Sales
1700 Executive
Similar topics
» How To Select All Columns of All Rows from a Table?
» How To Select Some Rows from a Table?
» Selecting Columns from a table
» What Is a SELECT Query Statement?
» Can SELECT Statements Be Used on Views?
» How To Select Some Rows from a Table?
» Selecting Columns from a table
» What Is a SELECT Query Statement?
» Can SELECT Statements Be Used on Views?
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