Parse varchar2 to table (Oracle)
问题 Is there built-in function in Oracle DB 11g r2 that could parse varchar2 variable to table? Opposite of listagg or wm_concat . I found only Tom Kyte 's method dated 2006: with data as ( select trim(substr (txt, instr(txt, ',', 1, level) + 1 , instr(txt, ',', 1, level + 1) - instr(txt, ',', 1, level) - 1)) as token from (select ',' || :txt || ',' txt from dual) connect by level <= length(:txt) - length(replace(:txt, ',', '')) + 1 ) select * from data; I think Oracle must have simpler way. 回答1: