I have a list of 15 values that I would like to concatenate to a comma separated list. Some of the values are null (which can be skipped) and I would like the list not to end in a comma. I would like to make the list so that if there are null values in between the SQL does not produce a list of values that look like: , , ,
For example:
select val1 || ', ' || val2 || ', ' val3
etc...
Should display: val1, val2, val3, etc.
Is there a clean way to do this in Oracle without a big case statement?