SQL tutorial | Interview questions | Oracle
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How To Select Some Rows from a Table?

Go down

How To Select Some Rows from a Table? Empty How To Select Some Rows from a Table?

Post by Micheal Sun Jan 17, 2010 3:01 am

If you don't want select all rows from a table, you can specify a WHERE clause to tell the query to
return only the rows that meets the condition defined in the WHERE clause. The following select
statement only returns rows that has department name starts with the letter "C":
SQL> SELECT * FROM departments WHERE department_name LIKE 'C%';
DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
130 Corporate Tax 1700
140 Control And Credit 1700
180 Construction 1700
190 Contracting 1700
......

Micheal
Admin

Posts : 243
Join date : 2010-01-10

http://sql-tutorial.co.cc

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum