Self-joins, EXISTS, and conditional aggregation
Joining a table to itself, the EXISTS/NOT EXISTS pattern, the NOT IN NULL trap, and pivoting rows into columns with CASE.
12 min readUpdated 2026-09-04sqlself-joinexistsconditional-aggregationadvanced
Joining a table to itself, the EXISTS/NOT EXISTS pattern, the NOT IN NULL trap, and pivoting rows into columns with CASE.