Recall where different SQL filters belong and why common filter traps happen.
battlecard comparison All filters belong in WHERE because WHERE means filter. Say this WHERE filters rows before grouping, but ON filters join matches and HAVING filters groups after aggregation. One word, filter, hides three different stages. It replaces a vocabulary shortcut with pipeline timing. ON condition vs WHERE condition in a LEFT JOIN Use ON when the condition defines optional matches that should not delete the left entity. How do you filter for missing values? Use IS NULL or IS NOT NULL. = NULL and != NULL do not behave like comparisons with real values. NULL check When does HAVING…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in