I am trying to merge a variable number of rows with one column into a single row. I find examples all over the place ordering by an id or some other value, but what if you don't care what the order is. You just the rows all flattened into one row regardless of order.
Basically I am trying to get the following
into a row reading 'Red, Blue, Green' without caring about sort order.
The only thing I have been able to figure out is to order by the single column name even though I don't care. I am just trying to simplify this as much as possible and possibly do it without a volatile or intermediate table.
Here is the code I have so far:
Which TD version? Have you seen this function, if it helps you,
select tdstats.udfconcat(trim(columns1)) from your_table;
We are currently using 13.1 and no, I had not seen that UDF before. I tried it out and it is not supported on our system. I will check with our DBA team and see if I can have it added.