How To Select Some Rows from a Table in Oracle?
Submitted by: AdministratorIf 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
2 WHERE department_name LIKE 'C%';
<pre>DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID
------------- -------------------- ---------- -----------
130 Corporate Tax 1700
140 Control And Credit 1700
180 Construction 1700
190 Contracting 1700
......</pre>
Submitted by: Administrator
SQL> SELECT * FROM departments
2 WHERE department_name LIKE 'C%';
<pre>DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID
------------- -------------------- ---------- -----------
130 Corporate Tax 1700
140 Control And Credit 1700
180 Construction 1700
190 Contracting 1700
......</pre>
Submitted by: Administrator
Read Online Oracle Database Job Interview Questions And Answers
Top Oracle Database Questions
☺ | How To Write Date and Time Interval Literals in Oracle? |
☺ | How To Create Tables for ODBC Connection Testing? |
☺ | How To Retrieve Data from an Explicit Cursor? |
☺ | What Is a Table Index in Oracle? |
☺ | What Happens to Indexes If You Drop a Table? |
Top DB Oracle Categories
☺ | Oracle PL-SQL Interview Questions. |
☺ | Oracle DBA Interview Questions. |
☺ | Oracle D2K Interview Questions. |
☺ | OCI Interview Questions. |
☺ | Oracle RMAN Interview Questions. |