Tag archive
Commands grouped around the same concept, pattern, or recurring problem.
Produce a row for every date in a range — even dates with no data — by generating a date spine and left-joining actual records onto it.
Put right-table filters in the `ON` clause when you want to keep unmatched left-side rows.
Generate the expected numbers and left join to the existing table to find missing ids or sequence values.
Find child rows whose foreign key value does not match any row in the parent table.
Return rows from one table that have no corresponding row in a second table using a LEFT JOIN with a NULL check.
Use a `LEFT JOIN` and filter for `NULL` on the joined table to find missing relationships.