Query inside the query is nested query.
It is also called as sub query.
Correlated subquery runs once for each row selected by the outer query. It contains a reference to a value from the row selected by the outer query.
Nested subquery runs only once for the entire nesting (outer) query. It does not contain any reference to the outer query row.
The subquerry is often reffered to as a nested SELECT, sub-SELECT, or inner SELECT statement. The subquery generally excuted first, and its output is used to complete the query condition for the main (or outer) query.
Difference between nested query,sub query and nested query?
Questions by pvsp.indian answers by pvsp.indian
Editorial / Best Answer
arpitapatelQuery inside the query is nested query.
It is also called as sub query.
Correlated subquery runs once for each row selected by the outer query. It contains a reference to a value from the row selected by the outer query.
Nested subquery runs only once for the entire nesting (outer) query. It does not contain any reference to the outer query row.
Related Answered Questions
Related Open Questions