The EXCEPT operator returns the rows of one query that are missing from another, with duplicates removed. This post shows the difference between two small order tables, the old WHERE 1 = 0 trick for distinct rows, and how NULLs behave.
SQL SERVER – Optimize Key Lookup by Creating Index with Include Columns
A query slowed to over 10 minutes because of a big key lookup. Here is how I optimize key lookup operations by creating an index with include columns.
SQL SERVER – Performance Comparison IN vs OR
Which query runs faster, one with IN or one with OR? Here is my performance comparison IN vs OR on AdventureWorks, and both turn out equal.
Adding Two Dates in SQL Server: Why the Year Is 2126
Adding two dates in SQL Server does not raise an error. It returns a date in the year 2126. This puzzle explains how datetime counts days from 1900, why the plus sign accepts a second date, and what to write instead.
Performance Comparison EXCEPT vs NOT IN – Interview Question of the Week #095
EXCEPT vs NOT IN: which is faster? An attendee at PASS Summit asked me, and my simple example shows they work the same way and perform the same.
SELECT One by Two – Interview Question Extended – Part II
After my SELECT One by Two puzzle, I played with a small extension: three queries mixing 1. and 1/2. Can you guess what each one returns and why?







