Subquery Basics: Scalar and Single Row Subqueries
A query inside a query. Learn where a subquery may appear, what each position requires it to return, and the error a scalar subquery raises when it re...
Scalar, multi row and correlated subqueries, EXISTS, and when to prefer a join.
4 notes
A query inside a query. Learn where a subquery may appear, what each position requires it to return, and the error a scalar subquery raises when it re...
Subqueries that return a list of values, and the three operators that consume them - including the NULL trap that makes NOT IN return nothing.
Subqueries that reference the outer row and run once per row. Learn EXISTS and NOT EXISTS, why they are NULL safe, and when correlation costs too much...
The same question answered four ways, with a straight comparison of readability, NULL safety and cost - and a rule for choosing between them.