tags:

views:

35

answers:

1

Is there a way to convert a list of values into a comma-delimited string in Informix? For example, I have the following query as a subselect:

SELECT [State] From States

I would like to convert all the values from that select into a comma-separated list.

Can I do that in informix?

+1  A: 

I think the answer you need is given in these questions: SO 715350, SO 489081. It shows how to create and use a GROUP_CONCAT() aggregate that will do exactly what you want. The functionality is otherwise not available - that is, you have to add it to Informix, but it can (fairly) easily be added.

Jonathan Leffler