RachelW
4Penny.net
Points: 7053

6/4/2021 1:34:49 PM

Comma separated values in a query

* This article, and all our great SQL (General) documentation, Is available on the SQL (General) menu

I've blogged on this several times, but each time the solution has been a little unwieldly for one reason or another. 

The job is to take a set of rows:

 

And return a comma separated field. 

Solution below

4Penny.net
Version: Unknown or N/A
Section: SQL Scripts
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3