472,139 Members | 1,680 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,139 software developers and data experts.

Clarification required while using correlated subqueries

Can anyone explain me when we use correlated subqueries rather than nested subqueries.
Do all the correlated subqueries can be written in nested subqueries form as well ?
What are the major conditions that apply whenever we write a correlated subquery and why we go for it ?
Please let me know about this as i am not clear which to use when.
Aug 28 '07 #1
4 2754
debasisdas
8,127 Expert 4TB
Usually writing a corelated subquery is the last option for sql developers.

It should always be avoided at any cost as it is the slowest as per performance.
Aug 29 '07 #2
So is it possible to write the nested subqueries from all the types of correlated subquery ? what are the advantages of writing a correlated subquery ? PLease let me know about this.
Aug 29 '07 #3
amitpatel66
2,367 Expert 2GB
CORRELATED SUBQUERIES should be written only in case when the SUB QUERY is dependent on one or more columns of outer query.
The Correlated sub query is executed once for each row of outer query.
Aug 29 '07 #4
debasisdas
8,127 Expert 4TB
So is it possible to write the nested subqueries from all the types of correlated subquery ? what are the advantages of writing a correlated subquery ? PLease let me know about this.
as i have already mentioned correlated subqueries should be the last option,if it is possible to write a nested or any other type of sub-suery ,correlated subqueries must and should be avoided .
Aug 29 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Jason | last post: by
11 posts views Thread by SQL_developer | last post: by
4 posts views Thread by sql_server_user | last post: by
5 posts views Thread by steven.fafel | last post: by
debasisdas
reply views Thread by debasisdas | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.