Wednesday, November 13, 2013

Correlated Subqueries

Correlated subqueries are subqueries where the inner query has refer a reference to a column from in the outer query.

As an example, suppose that you need to return products with the minimum unit price per category.



As another example of a correlated subquery, the following query returns customers who placed orders on particular day using EXISTS.



We can use NOT EXISTS also:

Cheers!

No comments:

Post a Comment