<<Previous Next>>
Oracle - What
is a subquery in Oracle? - June 27, 2009
at 11:00 AM
What is a subquery in
Oracle?
When a query needs to be run which has a condition that needs to
be a result of another query then, the query in the condition part
of the main one is called a sub-query. It is usually specified in
the WHERE clause and is evaluated repeatedly on each row of the
selection base table.
Eg:
select * from emp where hiredate < (select sysdate from dual);
This is just an example. The above query can be simply written as
follows:
select * from emp where hiredate <
sysdate;
Also read
A query which uses values from the outer query is called as a
correlated sub query. The subquery is executed once and uses the
results for all the evaluations in the outer query.............
Explain sub-queries in brief, What are the different operators
used in building sub queries?, What are the guidelines for using
SUB-QUERIES?, What is correlated sub-query?............
Table references can be complicated. So oracle allows you create
synonym for a complicated reference. It renames a table reference...........
|