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


Please Help Members By Posting Answers For Below Questions

Explain cascading triggers.

796


What privilege is needed for a user to connect to oracle server?

745


Why is oracle used?

702


ur a sql devoloper...what is the process in ur company for finding the database BUGS .. seperate DB testers are there? or devr.s are manage? if DB TESTERS in there what is the process

1985


What is a initialization parameter file in oracle?

754


What privilege is needed for a user to delete rows from tables in another schema?

751


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....

1791


What is an oracle database?

774


What is query image?

736


What is a view and how is it different from a table?

718


what is reindexing?

1336


How to get maxsal , minsal, ename department wise in single query

1286


What are the numeric comparison operations?

834


What is a directory object?

814


What is the Tune Query

2047