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
Slate-blue and sage ribbon loops around a wooden spindle, with a cream loop and vermilion end.

STRING_AGG Order: Keep NULLs and Type Width Visible

June 11, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Group By, SQL Server, SQL String

STRING_AGG order belongs inside WITHIN GROUP. This example preserves duplicate labels, shows how NULL differs from empty text and casts to nvarchar(max) before aggregation.

Read More
A wooden coin-sorting tray with coins stacked by size, one large coin stuck in the wrong channel, a bag of coins beside it.

GROUP BY Done Right

August 14, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Group By, SQL Joins, SQL NULL, SQL Server

GROUP BY Done Right separates row filters from group filters, handles NULL groups, and avoids totals inflated by careless joins.

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

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