Difference between sub query and nested query ?
Answer Posted / lakshmi
Correlated subquery runs once for each row selected by the
outer query. It contains a reference to a value from the
row selected by the outer query.
Nested subquery runs only once for the entire nesting
(outer) query. It does not contain any reference to the
outer query row.
For example,
Correlated Subquery:
select e1.empname, e1.basicsal, e1.deptno from emp e1 where
e1.basicsal = (select max(basicsal) from emp e2 where
e2.deptno = e1.deptno)
Nested Subquery:
select empname, basicsal, deptno from emp where (deptno,
basicsal) in (select deptno, max(basicsal) from emp group
by deptno)
| Is This Answer Correct ? | 96 Yes | 11 No |
Post New Answer View All Answers
What is format trigger?
Give syntax for SQL and ORACLE joins.
Explain the use of full option in exp command.
How to create a temporary table in oracle?
Explain the use of owner option in exp command.
What are nested tables?
What is a user account in oracle?
Explain drop constraint oracle?
query optmization techniques and quwry analyser+projects+ppts
what is difference between sql plus and sql*plus? (not sql and sql plus).
How to use like conditions in oracle?
What is the data pump import utility?
What are the parameters that we can pass through a stored procedure?
What privilege is needed for a user to create indexes in oracle?
What is rowid and rownum in oracle?