Split a string using XMLTABLE
27/09/22 09:56
Yet another way - specific to ORACLE - to split a comma-separated string into a set of rows.
SELECT t.column_value
FROM XMLTABLE(
q'{for $atom in distinct-values((ora:tokenize($VAL,","))) order by $atom return $atom}'
PASSING 'A,B,C,D' AS val
COLUMNS
column_value VARCHAR2(128) PATH '.'
) ;
A
B
C
D