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
A pale jigsaw puzzle with one red piece fitting into the gap and two loose gray pieces lying to the side.

Joining Tables in SQL Server: INNER, LEFT and FULL Joins

August 8, 2013
Pinal Dave
SQL Tips and Tricks
Database, SQL Joins, SQL NULL, SQL Scripts, SQL Table Operation

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.

Read More
Two rows of lettuces, a red marker stick standing in the one empty gap.

IS DISTINCT FROM in SQL Server 2022: NULL-Safe Comparisons

August 3, 2013
Pinal Dave
SQL Tips and Tricks
SQL NULL, SQL Operator, SQL Server, SQL Server 2022

Use IS DISTINCT FROM for NULL-safe comparisons in SQL Server 2022, understand older workarounds, and inspect index seeks before changing code.

Read More
Steel calipers gripping the widest of three turned wooden spindles on a workbench scattered with shavings.

GREATEST, LEAST and Other Small Helpers

June 10, 2013
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL NULL, SQL Server, SQL Server 2022

GREATEST, LEAST, and recent T-SQL helpers replace bulky CASE patterns while preserving explicit rules for NULL and data types.

Read More
Gouache painting of an empty bowl and a stone-filled bowl on a balance, above matching empty and occupied wooden recesses.

ANSI_NULLS Puzzle and NULL in SQL Server: SQL in Sixty Seconds #052

May 29, 2013
Pinal Dave
SQL Video
SQL Deprecated Feature, SQL in Sixty Seconds, SQL NULL, SQL Scripts

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.

Read More
A shuttlecock resting exactly on a court's boundary line, two rackets lying still on either side of the net.

Three-Valued Logic: TRUE, FALSE and UNKNOWN in a WHERE Clause

May 15, 2013
Pinal Dave
SQL Tips and Tricks
SQL NULL, SQL Operator, SQL Server, SQL Server 2022, SQL Sub Query

Understand three-valued logic in WHERE and CHECK, avoid NULL-poisoned NOT IN, and use SQL Server 2022 null-safe comparisons.

Read More
Gouache painting of a harbor anchor chain broken in two by a missing link, with the lone link painted red

CONCAT_NULL_YIELDS_NULL and CONCAT: How NULL Behaves in Strings

May 12, 2013
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL NULL, SQL Scripts, SQL Server

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.

Read More
Three sorting bins in a row with a red rubber boot on the ground that fits none.

CASE Expression Pitfalls: NULL Tests and Data Type Precedence

April 20, 2013
Pinal Dave
SQL Tips and Tricks
SQL CASE, SQL Datatype, SQL NULL, SQL Server

Reproduce CASE expression traps with NULL tests, mixed result types, missing ELSE, and nesting, then apply clear rewrites.

Read More
Previous 1 … 3 4 5 6 7 8 9 … 13 Next
  • Books
  • Testimonials
  • Privacy Policy

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