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

Customer Tax Registration - EBS Query

              SELECT DISTINCT  hp.party_type, hp.party_name, hca.account_name, hp.party_number, hps.party_site_number, ...