Tag archive
Commands grouped around the same concept, pattern, or recurring problem.
Count or sum only the rows that match a specific condition without a WHERE clause — using `FILTER (WHERE ...)` in PostgreSQL and SQLite, or `CASE WHEN` inside the aggregate for other engines.
Turn distinct row values into separate columns using `CASE WHEN` inside an aggregate.
Set a column to different values depending on other column values in the same row by using `CASE WHEN` inside a `SET` clause.