Search code examples
selectoracle10ginversion

select the inverse of sql result as a string list


having a sql e.g. something like the following resulting in some rows with one value. I search a different sql than SELECT * FROM some_sql which results in one row with comma separated values.


WITH some_sql AS (
  SELECT 1 FROM DUAL
  UNION
  SELECT 2 FROM DUAL
)
SELECT * FROM some_sql

this SQL results in the two rows with value 1 and 2. I seach a SQl resulting in 1,2 without changing the code of 'some_sql'.


Solution

  • Consider http://halisway.blogspot.com/2006/08/oracle-groupconcat-updated-again.html