Question Robert Stephens · Sep 30, 2024

Combine all rows in select into one comma delimited string

I've got a select statement bringing back one value, I want to combine all rows into one comma delimited string. So for example:

SELECT First Name

FROM mydb.People

I get a list of names:

John

Fred

Sarah

Carl

Jane

Julie

Instead of having 6 rows in the result, I want one row, with one cell that has "John,Fred,Sarah,Carl,Jane,Julie"

Is there a way to do that?

Product version: Caché 2018.1

Comments

Julius Kavay · Sep 30, 2024
select list(FirstName) from mydb.People

should do the trick.

0
Robert Stephens  Oct 1, 2024 to Julius Kavay

That worked great thank you! I've done this type of thing in SQL, PostGres, and Oracle (a while back) but pretty new to Cache.

0