Difference between co-related query and co-related sub query

Questions by prince23

Showing Answers 1 - 1 of 1 Answers

kirangsv

  • Jun 2nd, 2008
 

Co-related sub-query:- The main differencre between subquery and co-related subquery is that in subquery child query is executed first n then parent,but in co-related subquery main query is executed first(even though parenthesis are present) and then child query.

Example of co-related subquery

select dname from dept where exists
(select deptno from emp
where dept.deptno=emp.deptno);

select dname from dept where not exists
(select deptno from emp
where dept.deptno=emp.deptno);

 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions