The goal is to convert all the row values in a column to a single concatenated list.
You can change the space separated by comma or other csv like fields.
Example of a result:
id1 addres1 addres2 addres3
id3 addres5 addres6
id4 addres7 addres8 addres9 addres10 addres11
max(decode(my_seq,1,ADDRESS)) || ‘ ‘ ||
max(decode(my_seq,2,ADDRESS)) || ‘ ‘ ||
max(decode(my_seq,3,ADDRESS)) || ‘ ‘ ||
max(decode(my_seq,4,ADDRESS)) || ‘ ‘ ||
(partition by ID order by ADDRESS) my_seq
WHERE ADDRESS IS NOT NULL
group by ID
order by 1
Author: Vincent Fenoll Oracle DBA Montreal
compatibility: Oracle 10g 11g 12c