IN, BETWEEN, LIKE and IS NULL
The four filtering shortcuts you will use constantly: set membership, ranges, pattern matching with wildcards, and the only correct way to test for NU...
963 published notes across every category.
The four filtering shortcuts you will use constantly: set membership, ranges, pattern matching with wildcards, and the only correct way to test for NU...
Concatenating, trimming, slicing, replacing and searching text - and which of these functions changes name in every dialect.
Rounding, truncating, absolute values, modulo and integer division - and the rounding rules that decide whether your invoice totals balance.
Current date and time, adding and subtracting intervals, differences between dates, extracting parts, and formatting - the least portable corner of SQ...
Conditional logic inside a query, NULL substitution, safe division and explicit type conversion - four tools that remove most procedural code from SQL...
NULL is not zero, not an empty string and not equal to itself. Learn what it represents, how it spreads through expressions and how to handle it delib...
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 five aggregate functions that collapse many rows into one value, the three forms of COUNT, and what each one does with NULL.
Aggregating an expression rather than a column: weighted totals, conditional counts and the difference between counting rows and counting facts.
GROUP BY collapses rows into one row per distinct key. Learn the single rule that governs the select list and how NULLs are grouped.
HAVING filters groups after aggregation, WHERE filters rows before it. Learn when each applies, why using both is usually correct, and which is faster...
Grouping by several columns, grouping by expressions, and the totals features - ROLLUP, CUBE and GROUPING SETS - that add subtotal rows.