Subqueries
SUBQUERIES :¶
A Subquery or Inner query or a Nested query is a query within another SQL query and embedded within the WHERE clause.
A subquery is used to return data that will be used in the main query as a condition to further restrict the data to be retrieved.
EX :
1 2 | |
CORELATED SUBQUERIES :¶
If the subquery depends on the outer query for its values is calles as corelated subqueries.
Corelated subquery can not be executed independently of the outer query.
ex :
1 2 3 | |