Correlated Subquery versus Subquery [message #9373] |
Thu, 06 November 2003 08:42 |
CB
Messages: 17 Registered: November 2003
|
Junior Member |
|
|
Hello,
I need some clarification regarding subquery versus correlated subquery.
In a subquery, the inner query executes first and returns the results to the outer query to be processed.
In a correlated subquery the outer query executes first and as it processes each row, the subquery is using the information supplied by the results of the outer query.
Is my understanding of the two types of queries correct? I read many documents that say it differently. I am asking in respect to how Oracle would process a subquery vs correlated subquery.
Thanks,
cb
|
|
|
Re: Correlated Subquery versus Subquery [message #9393 is a reply to message #9373] |
Fri, 07 November 2003 14:07 |
ashish
Messages: 107 Registered: December 2000
|
Senior Member |
|
|
dear x,
you are absolutely right.
In case of subquery the inner query execute first and then outer query and both the queries run only once.
but in case of correlated :
for every run of outer query the inner query runs that many times till the condition is true.
|
|
|
|
|