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
Gouache painting: two open burlap sacks stand side by side

INTERSECT: Return Shared Values Once

May 7, 2009
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

INTERSECT returns distinct shared rows, including shared NULL. Compare it with an equality join that preserves matching-pair multiplicity.

Read More
Gouache painting: on an identical drum beside it, a cord cut from a rounded-off measure falls a hair short, leaving a tiny visible gap beside a small vermilion knot

PI: Choose the Precision of a Circle Calculation

May 4, 2009
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts, SQL Server

PI provides an approximate circle constant. This example keeps radius, circumference and two area calculations together to show when a chosen decimal conversion occurs.

Read More
A pale stone courtyard path is bordered by white stones, with loose slate, terracotta bricks and a shell beside the edge.

geometry STIntersection: Return the Shared Shape

April 30, 2009
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

geometry STIntersection returns the shared shape rather than only an intersection flag. I inspect its type and emptiness alongside its area. A shared edge has zero area but still contains points.

Read More
SQL SERVER - Leading Zero to Number

SQL SERVER – Leading Zero to Number

April 24, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

Readers keep asking how to add a leading zero to a number. Here are my two earlier articles that pad a number with zeros for a fixed width display.

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
Gouache painting: three stations on a workshop wall and bench

SPACE: Keep Blank Text, Empty Text and NULL Distinct

April 22, 2009
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Server

SPACE builds a present blank string from a count. Keep empty text and NULL separate, and choose a measurement that retains supplied spaces.

Read More
Previous 1 … 58 59 60 61 62 63 64 … 92 Next
  • Books
  • Testimonials
  • Privacy Policy

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