See why NOT IN with a NULL returns no customers, then compare five sample rows, NOT EXISTS, an IS NOT NULL filter, and query plans.
Add Columns With NULL in SQL Server: ISNULL, COALESCE or SUM
To add columns with NULL in SQL Server, first decide what an empty value means. This post sums three nullable columns with the plus operator, ISNULL, COALESCE and SUM, shows where each one differs on a row of all NULLs, and compares their CPU cost on two million rows.
SQL SERVER – NULL Values and CONCAT Function
A lot of SQL in the Sixty Seconds video recently, we will be looking at a very interesting T-SQL CONCAT function and how it works with the NULL Values.
SQL Puzzle – Solution to Strange Results – IN and IS NOT NULL –
Earlier I had published a blog post about a puzzle SQL Puzzle – IN and IS NOT NULL – Strange Results. Today we will see a solution to strange results puzzle.
DEFAULT WITH VALUES: Fill Existing Rows on a New Column
DEFAULT WITH VALUES fills the rows that already exist when you add a column with a default. Without it, a nullable column keeps NULL in every old row. This post shows the three cases side by side, what a default never does, why the constraint needs a name, and how a large table takes the change in a millisecond.
SQL Puzzle – IN and IS NOT NULL – Strange Results
Today, let us see a very simple puzzle where we are getting strange results when using NOT IN and IS NULL in a T-SQL query.
Count NULLs in a Column in SQL Server: Five Ways Compared
To count NULLs in a column, filter with IS NULL and count the rows, or subtract COUNT(column) from COUNT(*). This post tests five ways on 100,000 rows and compares their page reads. It also counts NULLs in several columns at once and shows the NULL group in GROUP BY.





