HAVING, and WHERE vs HAVING
HAVING filters groups after aggregation, WHERE filters rows before it. Learn when each applies, why using both is usually correct, and which is faster...
Restricting rows with conditions.
5 notes tagged
HAVING filters groups after aggregation, WHERE filters rows before it. Learn when each applies, why using both is usually correct, and which is faster...
SQL conditions return three results, not two. Learn the AND, OR and NOT truth tables, why NOT IN breaks on NULL, and the NULL safe comparison operator...
The four filtering shortcuts you will use constantly: set membership, ranges, pattern matching with wildcards, and the only correct way to test for NU...
Combining conditions correctly. Precedence between AND and OR, what NOT does to a NULL, and how to keep complex filters readable and index friendly.
WHERE decides which rows survive. Learn the comparison operators, how conditions are evaluated per row, and why a function around a column kills an in...