Wednesday, August 21, 2013

Nested and Correlated Queries

If a subquery contains another sub query inside it the its called nested sub query. there could be multiple no of nesting possible in a sub query.
if two sub queries or queries are dependent on each other then its called correlated subqueries.
select EmpName , (select Empname from emp where empid=a.managerid) as manager
from Emp A
in this example a column is used in upper sub query then its correlated subquery.

No comments:

Post a Comment