Tag archive
Commands grouped around the same concept, pattern, or recurring problem.
Remove rows from one table when a matching row exists in another table using a subquery.
Embed a `SELECT` inside another query to filter, compute, or supply values that depend on aggregated or derived data.
Use `LATERAL` (or `CROSS APPLY` on SQL Server) to let a subquery reference columns from the preceding table in the `FROM` clause.
Use a correlated subquery inside `EXISTS` to include rows only when related rows are found in another table.
Filter `NULL` values out of the right side before using `NOT IN`, or the predicate can exclude everything.