Oracle
 sql >> Database >  >> RDS >> Oracle

Dividi la colonna CLOB in base alla nuova riga - Oracle SQL

Puoi utilizzare una hierarchical query senza un JOIN condizione :

select t1.*, level as line_num, 
       regexp_replace( regexp_substr( t1.f_content,'[^~]+', 1, level), '(^[[:space:]]+)' ) 
       as line
  from table1 t1
 connect by level <= regexp_count(f_content, '~')   
    and prior f_name = f_name
    and prior sys_guid() is not null

Demo