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 stone-sorting tray has visible stones and one linen-covered compartment concealing its contents.

Nullable NOT IN: Read the Row Count Spool Carefully

November 14, 2008
Pinal Dave
SQL Performance
SQL NULL, SQL Performance, SQL Sub Query

Nullable NOT IN needs a clear rule for unknown identifiers. Compare NULL and empty-set results before changing the query or interpreting a Row Count Spool.

Read More
Gouache painting: on a workbench, a pair of plain smooth brass tweezers holds one polished clay marble, while a wide wooden clamp holds a bundle of three marbles tied with string; a loose marble and a second tied bundle lie nearby, one string vermilion

JSON_QUERY or JSON_VALUE: Match the JSON Shape

October 13, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL NULL, SQL Server, SQL String

JSON_QUERY or JSON_VALUE depends on the JSON shape you need. One read-only document exposes scalar, object, array, JSON null and missing-path results side by side.

Read More
Five cream, sage and slate-blue ceramic cups on a pale shelf, beside a terracotta pebble.

GREATEST and LEAST: Find Row Extremes With NULLs

August 27, 2008
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL NULL, SQL Server

GREATEST and LEAST compare several expressions within one row. These typed decimal examples show negative numbers, ties, partial NULLs and an entirely missing row.

Read More
A long pale wooden plank over a triangular support, beside a red wooden cube.

NULLIF Denominators: Keep Zero and Missing Values Visible

July 25, 2008
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL NULL, SQL Server

NULLIF denominators turn zero into NULL for a deliberate division policy. This complete example keeps zero, missing inputs and integer truncation visible beside the decimal result.

Read More
Two overlapping wooden rails share a fitted bridge on a richly painted workshop bench

Salary Ranges: Match Overlapping Intervals in SQL Server

February 1, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Joins, SQL NULL, SQL Server

Match salary ranges using both boundaries of the job and candidate intervals. Define open bounds and test containment, endpoint contact and invalid input.

Read More
A soil sieve over a wheelbarrow, fine soil fallen through while stones and roots stay caught on the mesh.

Check Constraints That Enforce Business Rules

December 24, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Constraint and Keys, SQL NULL, SQL Server

Check constraints keep row rules inside SQL Server, but NULL behavior and trusted status determine how much protection they provide.

Read More
Red, blue and gray felt hats share different levels of a wooden display shelf.

TOP WITH TIES: Keep Every Row at the Cutoff

November 14, 2007
Pinal Dave
SQL Tips and Tricks
SQL NULL, SQL Order By, SQL Scripts, SQL Server

TOP WITH TIES helps me keep equally qualified rows at a shortlist boundary. A unique ordering key changes that selection. Separate the cutoff rule from the final display order.

Read More
Previous 1 … 7 8 9 10 11 12 Next
  • Books
  • Testimonials
  • Privacy Policy

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