Joining Tables lets one query combine rows from two tables that share a value. This post uses small Customers and Orders tables to show what INNER, LEFT and FULL OUTER joins return, how many rows each one gives, and how to read the rows that have no match.
IS DISTINCT FROM in SQL Server 2022: NULL-Safe Comparisons
Use IS DISTINCT FROM for NULL-safe comparisons in SQL Server 2022, understand older workarounds, and inspect index seeks before changing code.
GREATEST, LEAST and Other Small Helpers
GREATEST, LEAST, and recent T-SQL helpers replace bulky CASE patterns while preserving explicit rules for NULL and data types.
ANSI_NULLS Puzzle and NULL in SQL Server: SQL in Sixty Seconds #052
This ANSI_NULLS puzzle starts with two queries that look alike, and only one returns a row. The tests here explain the NULL logic behind IN and NOT IN, show what SET ANSI_NULLS OFF still does on SQL Server 2025, and give a safer pattern for real queries.
Three-Valued Logic: TRUE, FALSE and UNKNOWN in a WHERE Clause
Understand three-valued logic in WHERE and CHECK, avoid NULL-poisoned NOT IN, and use SQL Server 2022 null-safe comparisons.
CONCAT_NULL_YIELDS_NULL and CONCAT: How NULL Behaves in Strings
The CONCAT_NULL_YIELDS_NULL setting decides whether a string plus NULL returns NULL. The CONCAT function never looks at it and treats NULL as an empty string. This post tests both on a customer table, shows the errors the OFF setting causes, and gives safe patterns for names and numbers.
CASE Expression Pitfalls: NULL Tests and Data Type Precedence
Reproduce CASE expression traps with NULL tests, mixed result types, missing ELSE, and nesting, then apply clear rewrites.







