0

Does anyone know how to concatenate all the values of a column in a query using SQL only? I know that there are ways using database specific tools such as pivot, but I don't think I have access to something like that in infomaker.

I am using infomaker to produce labels for sample bottles. The bottles can be analysed for more than one thing. If I join the bottle and analysis tables I get several rows per bottle which results in multiple labels, so I was hoping to concatenate all the values for the analysis using SQL and then use a computed value based on this to add something useful to the label. I can only use 1 transaction based on a select query to do this.

Adding additional tables or columns to the database would be highly discouraged.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Graham Anderson
  • 1,209
  • 10
  • 17

1 Answers1

0

In some oracle version you can use wm_concat

SELECT field1, wm_concat(field2) FROM YourTable 
GROUP BY field2;

otherwise you can use listagg

ScaisEdge
  • 131,976
  • 10
  • 91
  • 107