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
Two groups of sage, blue and cream cloths hang above a table with a red cord.

Date Conversion Styles: Disambiguate Day and Month

July 31, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL NULL, SQL Scripts, SQL Server

Date conversion styles define how incoming text becomes a date. Compare month-first and day-first interpretations without guessing. Keep invalid dates separate from missing input.

Read More
A hand fits a brass hinge pin while matching spare pins lie on the bench.

Finding Duplicates Before Adding a Unique Constraint

July 27, 2009
Pinal Dave
SQL Tips and Tricks
Duplicate Records, Ranking Functions, SQL Constraint and Keys, SQL Group By, SQL NULL

A unique constraint fails on the first duplicate it meets and tells you about only one. Here is how to list them all and clean up safely.

Read More
Blue, sage and cream textile panels hang in order above folded cloth and a red spool.

CASE Sort Priority: Put Business Order Before Alphabetical Order

May 10, 2009
Pinal Dave
SQL Tips and Tricks
SQL CASE, SQL NULL, SQL Order By, SQL Server

CASE sort priority makes the queue policy explicit. Map known statuses to numeric ranks and keep missing or unfamiliar labels visible. Finish tied ranks with a unique key.

Read More
Gouache painting: along a long bakery bench stands a row of six pie tins, some holding baked pies and some empty

LAG IGNORE NULLS: Read the Previous Available Value

April 24, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL NULL, SQL Order By, SQL Server

LAG IGNORE NULLS reads the previous non-NULL value within an ordered partition. These examples distinguish skipped rows, missing previous values and the supplied default.

Read More
Coarse brass rods and fine needles stored in separate leather tool rolls.

Decimal Division: Inspect Precision Before the Final Cast

April 23, 2009
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL NULL

Decimal division derives its own precision and scale before your final cast. Compare wide and bounded inputs, then test rounding and valid numeric ranges.

Read More
Four places at a wooden table, with cake at two ribbon-marked cards and a hand lowering the second plate.

LEFT JOIN ON Clause: Conditions Decide Matches, Not Rows

March 15, 2009
Pinal Dave
SQL Tips and Tricks
SQL Joins, SQL NULL, SQL Scripts

Why a condition in ON keeps every customer, why a left-side condition removes nobody, and how one WHERE quietly undoes two LEFT JOINs.

Read More
A full molasses ladle hangs beside an empty ladle and a bare hook.

Percent Change Between Rows: Handling Zero and NULL Safely

December 13, 2008
Pinal Dave
SQL Tips and Tricks
Best Practices, Mathematical Function, SQL Function, SQL NULL

One zero month can kill a revenue report. Here is how to get percent change without errors or lies.

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

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