This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Five wooden cups on a felt table, four turned up empty and one still covered.

NOT IN With a NULL in the List Returns No Rows

April 8, 2021
Pinal Dave
SQL Tips and Tricks
SQL NULL, SQL Operator, SQL Server, SQL Sub Query

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.

Read More
Gouache painting of three fruit bowls in a row where two hold pears and the middle one is empty and vermilion

Add Columns With NULL in SQL Server: ISNULL, COALESCE or SUM

October 19, 2020
Pinal Dave
SQL Tips and Tricks
SQL NULL, SQL Operator, SQL Scripts

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.

Read More
NULL Values

SQL SERVER – NULL Values and CONCAT Function

September 11, 2020
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL NULL, SQL String

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.

Read More
strange results

SQL Puzzle – Solution to Strange Results – IN and IS NOT NULL –

July 10, 2020
Pinal Dave
SQL Puzzle
SQL NULL, SQL Scripts, SQL Server

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.

Read More
Gouache painting of a row of clay pots with the first few filled with soil and a vermilion scoop in a soil bag

DEFAULT WITH VALUES: Fill Existing Rows on a New Column

June 27, 2020
Pinal Dave
SQL Tips and Tricks
SQL Column, SQL Constraint and Keys, SQL NULL, SQL Scripts

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.

Read More
strange results

SQL Puzzle – IN and IS NOT NULL – Strange Results

June 17, 2020
Pinal Dave
SQL Puzzle
SQL NULL, SQL Scripts, SQL Server

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.

Read More
Gouache painting of a seedling tray with most cells sprouted and three empty, with a vermilion watering can beside it

Count NULLs in a Column in SQL Server: Five Ways Compared

March 5, 2020
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Group By, SQL NULL, SQL Scripts

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.

Read More
Previous 1 2 3 4 5 … 12 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com