I have several comma seperated lists (A,B,..) in different scopes (102,103,...):
SCOPE_ID LIST_NAME LIST_OF_NODES
102 list_A 02086,02087,02089,02131,02210,02211
102 list_B 00004,06003,06338
103 list_A 00705,02006,02017,02057,02085
103 list_B 09442,09443
...
I need to get a table of format:
SCOPE_ID LIST_NAME NODE_ID
102 list_A 02086
102 list_A 02087
102 list_B 00004
...
103 list_A 00705
103 list_A 02006
103 list_B 09442
...
I already know how to get LIST_OF_NODES split by comma:
select SCOPE_ID, LIST_NAME, NODE_ID,
substr(NODE_ID,instr(NODE_ID,',',1,decode(level-1,0,1,level-1))-5,5) node
from (
select '102' SCOPE_ID,
'LIST_A' LIST_NAME,
'00705,02006,02017,02057,02085,02086,02087,02089,02131,02210,02211' NODE_ID
from dual )
connect by level<=regexp_count(NODE_ID,',')+2 ;
...but how to do it for multiple lists and scopes?