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
How to delete a column in an existing table?
What is connection pool in oracle?
What are the benefits of ordbms?
Oracle
Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.
how do we code triggers , store procedure , Performance tuning and indexing in a Java Project? Pls kindly get me the perfect answer with the code for each....thank you in advance............pls any body kindly help me soon as possible....
What is Segment Advisor in Oracle?
What is the difference between pre-select and pre-query?
How to save query output to a local file?
What is coalesce function?
How to commit the current transaction in oracle?
How to define an anonymous procedure with variables?
What is hash cluster in oracle?
How to create a stored procedure in oracle?
Difference between inner join vs where ?