Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Use Subqueries in the FROM clause
How To Use Subqueries in the FROM clause? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements
✍: FYIcenter.com
If you have a query returning many rows of data, and you want to perform another query on those rows, you can put the first query as a subquery in the FROM clause of the second query. The following statement shows you how to use a subquery as base table for the main query:
SQL> SELECT * FROM ( 2 SELECT first_name, last_name, department_name 3 FROM employees e, departments d 4 WHERE e.department_id = d.department_id 5 ) WHERE department_name LIKE 'S%' ORDER BY last_name; FIRST_NAME LAST_NAME DEPARTMENT_NAME ----------------- ---------------------- --------------- Ellen Abel Sales Sundar Ande Sales Mozhe Atkinson Shipping Amit Banda Sales Elizabeth Bates Sales Sarah Bell Shipping ......
2007-04-19, 4986👍, 0💬
Popular Posts:
How To Export Data to a CSV File? - Oracle DBA FAQ - Introduction to Oracle SQL Developer If you wan...
Can you have virtual functions in Java? Yes, all functions in Java are virtual by default. This is a...
How To Truncate an Array? - PHP Script Tips - PHP Built-in Functions for Arrays If you want to remov...
What Are the Parameter Modes Supported by PL/SQL? - Oracle DBA FAQ - Creating Your Own PL/SQL Proced...
What will happen in these three cases? if (a=0) { //somecode } if (a==0) { //do something } if (a===...