UNION Is Making Your Query Three Times Slower for No Reason
UNION deduplicates and pays for it; UNION ALL does not. When to use each, plus the column mistakes everyone hits.
UNION Is Making Your Query Three Times Slower for No Reason Đọc thêm »
UNION deduplicates and pays for it; UNION ALL does not. When to use each, plus the column mistakes everyone hits.
UNION Is Making Your Query Three Times Slower for No Reason Đọc thêm »
Three ways to find duplicate rows and how to delete all but one, using GROUP BY HAVING or ROW_NUMBER.
Finding and Deleting Duplicates Without Losing the Original Đọc thêm »
CROSS JOIN builds every combination of two tables. Use it to fill report gaps, and watch out for the row explosion.
CROSS JOIN: The Only Way to Make Zero Rows Appear Đọc thêm »
Three ways to write an anti-join: LEFT JOIN IS NULL, NOT EXISTS and NOT IN, and why NOT IN can return nothing at all.
Finding What Is NOT There: Three Ways, One Correct Đọc thêm »
How to use a self-join to compare rows within one table, three common mistakes, and the matching LeetCode problems.
Self-Join: Comparing One Row Against Another in the Same Table Đọc thêm »
TRIM, UPPER, CONCAT, SUBSTRING and REPLACE — five string functions that handle most data cleaning inside SQL.
Messy Customer Names: Cleaning Them With Five String Functions Đọc thêm »
Filtering date ranges correctly, adding and subtracting days, measuring gaps, and grouping by month without killing your index.
Your Date Filter Is Silently Dropping a Whole Day Đọc thêm »
CASE WHEN syntax, why condition order changes your results, and three mistakes that turn every row into NULL.
CASE WHEN: Writing if-else Inside a SQL Query Đọc thêm »
How LIKE works with % and _, case sensitivity across databases, and why a leading wildcard makes your index useless.
LIKE %abc% and Why Your Query Got 200 Times Slower Đọc thêm »
AND is always evaluated before OR in SQL. Here is why your filter returns rows you never asked for, and how brackets fix it.
One Missing Bracket Adds 40% Extra Rows to Your Report Đọc thêm »