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
Sixteen pineapples in a row by size, split into four groups by wooden slats, one huge pineapple set apart.

Quartiles With PERCENTILE_CONT and NTILE

January 1, 2021
Pinal Dave
SQL Tips and Tricks
Mathematical Function, Ranking Functions, SQL Function, SQL Server

Compare quartiles from PERCENTILE_CONT with NTILE row buckets, calculate interquartile range, and flag candidates beyond 1.5 IQR.

Read More
A glass water jug refilled from three tumblers, stopping just below its red rim line.

Why FLOAT Math Does Not Add Up in T-SQL Queries

May 13, 2020
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Datatype, SQL Server

See why FLOAT math produces approximate sums and comparisons in SQL Server, then use DECIMAL or tolerance checks for the right data.

Read More
A bowl of cake batter, a big scoop of flour and a small spoon of cocoa going in, the mix turning only faintly brown.

Weighted Averages in T-SQL

March 28, 2020
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Function, SQL Scripts, SQL Server

Calculate weighted averages with matching numerator and denominator populations, decimal arithmetic, NULL rules, and calendar windows.

Read More
A row of meshed brass gears getting smaller, ending in a tiny red gear, one broken gear set aside

The PRODUCT Aggregate: Multiplying Values Across Rows

October 22, 2013
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Function, SQL NULL, SQL Server

Use the PRODUCT aggregate in SQL Server 2025 for growth factors and independent probabilities, with checks for NULL, zero, and precision.

Read More
Equal lengths of plank stacked neatly, a large leftover piece dropped in a red scrap bin.

Integer Division in T-SQL: Why Your Percentages Come Out Zero

August 17, 2013
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Datatype, SQL Server

Fix integer division in T-SQL percentages from COUNT, SUM and window calculations with decimal types and rounding at the right step.

Read More
Two rows of tulips, one all red and one in randomly mixed colors.

Generating Random Numbers Per Row: RAND, NEWID and CRYPT_GEN_RANDOM

February 2, 2013
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Function, SQL Random, SQL Server

Generate random numbers per row with NEWID or CRYPT_GEN_RANDOM, compare seeded RAND, inspect bucket spread, and pick a row without a sort.

Read More
A knife leveling flour in the smallest of a set of measuring spoons

Decimal Precision and Rounding in SQL Server

November 12, 2007
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Datatype, SQL Function, SQL Server

Decimal precision in SQL Server controls arithmetic results and rounding; use explicit scales, test boundaries, and compare money with decimal.

Read More
Previous 1 2
  • Books
  • Testimonials
  • Privacy Policy

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