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.
GROUP BY Done Right
GROUP BY Done Right separates row filters from group filters, handles NULL groups, and avoids totals inflated by careless joins.


