Wednesday, October 25, 2017

Oracle 11g - REGEXP_SUBSTR extract comma delimiter string to fields

select REGEXP_SUBSTR('CHIDAM,,20-Feb-17,1-Feb-19', '([^,]*)(,|$)', 1, 1,NULL,1) f1,
REGEXP_SUBSTR('CHIDAM,,20-Feb-17,1-Feb-19', '([^,]*)(,|$)', 1, 2,NULL,1) f2,
REGEXP_SUBSTR('CHIDAM,,20-Feb-17,1-Feb-19', '([^,]*)(,|$)', 1, 3,NULL,1) f3,
REGEXP_SUBSTR('CHIDAM,,20-Feb-17,1-Feb-19', '([^,]*)(,|$)', 1, 4,NULL,1) f4

from dual

Output

F1
F2
F3
F4
CHIDAM

20-Feb-17
1-Feb-19

No comments:

Post a Comment

Price List Query for Item

 SELECT qph.list_header_id,        qph.name,        qph.description,        qphh.start_date_active,        qphh.currency_code,        q...