October 6, 2005 at 1:03 am
what is corelated subquery?what is use to? and difference b/w independent and corelated sub query?
October 6, 2005 at 2:38 am
A correlated subquery is a subquery that refers to the outer query. For instance:
SELECT *
FROM FOO<
WHERE EXISTS (
SELECT *
FROM BAR
WHERE BAR.x = FOO.y )
October 6, 2005 at 3:20 am
As you can see from Chris' example, the subquery cannot execute without the parent query - this is what 'corelated' refers to.
An independent subquery can run in isolation, eg
select * from table1 where id in (select id from table2)
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply