Help!

Suppose there is a table of two columns. The row values ​​in the first column look like:

слово1/слово2/слово3/.../слово N 

in the second:

 число1/число2/число3/.../число N 

You need to parse the lines so that each such line is split into N lines in the form:

 слово1 число1 слово2 число2 слово3 число3 ... словоN числоN 
  • You have already tried, but does not work? Please publish your sample and test data in the form - select ... from dual . - 0xdb
  • Why is the "word1" matched as a result with the "number1"? In order in the initial data? - hinotf

1 answer 1

In case the source data lines are multiple and they have some unique ID:

  select id, regexp_substr(word, '[^/]+',1,level) w, regexp_substr(num , '[^/]+',1,level) from test connect by id=prior id and prior dbms_random.value is not null and ( regexp_substr(word, '[^/]+',1,level) is not null or regexp_substr(num , '[^/]+',1,level) is not null ) 

If there is only one line, then connect by course will not need to verify the ID (so as not to paste the words with numbers from different records) and the condition with dbms_random is not needed either.