Home » SQL & PL/SQL » SQL & PL/SQL » EXISTS Vs Correlated subquery
EXISTS Vs Correlated subquery [message #215720] Tue, 23 January 2007 11:34 Go to next message
Messages: 35
Registered: August 2006
Hi all,

Could you tell me which one is better to use (EXISTS or Correlated subquery) and why?

Re: EXISTS Vs Correlated subquery [message #215722 is a reply to message #215720] Tue, 23 January 2007 11:41 Go to previous message
Messages: 381
Registered: September 2006
Location: UK
Senior Member
In my experience, an EXISTS usually is a correlated subquery. A correlated subquery is any query in which the tables in the subquery are joined back to a table or tables in the main query e.g.

select * from emp e
where exists
(select 1 from dept d
where d.dept_id = e.dept_id)

This would be a correlated subquery. It would only be not correlated if you had something like:

select * from emp e
where exists
(select 1 from dept d)

Previous Topic: How to Upload From Client to FTP with PL/SQL Server Pages
Next Topic: ORA-00942 ERROR
Goto Forum:

Current Time: Mon Oct 24 08:05:03 CDT 2016

Total time taken to generate the page: 0.06942 seconds