top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What do you mean by Correlated subquery ?

+3 votes
385 views
What do you mean by Correlated subquery ?
posted Feb 1, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Subqueries, or nested queries, are used to bring back a set of rows to be used by the parent query. Depending on how the subquery is written, it can be executed once for the parent query or it can be executed once for each row returned by the parent query. If the subquery is executed for each row of the parent, this is called a correlated subquery.
A correlated subquery can be easily identified if it contains any references to the parent subquery columns in its WHERE clause. Columns from the subquery cannot be referenced anywhere else in the parent query. The following example demonstrates a non-correlated subquery.
Example: Select * From CUST Where '10/03/1990' IN (Select ODATE From ORDER Where CUST.CNUM = ORDER.CNUM)

answer Feb 2, 2014 by Vikas Upadhyay
Similar Questions
+3 votes

What is the difference between sub & correlated subquery and In which case do we use each of them?

+4 votes

What are the implications of having it OFF?

...