I have a column A which contain 4 fields separated by ‘/’
example: 234-12-343/653423/MANAGER/yg@gmail.com
Wonder how can i extract field index 2 ? so the final output will be 653423.
(My idea is using regular expression, but have no idea how to do it)
*Database is Oracle 10g
I was able to come out these query. Thanks for the help
select substr(ColumnA',
regexp_instr(ColumnA,'[\/]',1,1,0) + 1,
regexp_instr(ColumnA,'[\/]',1,2,0) - regexp_instr(ColumnA,1,1,0) - 1 )
as test from dual
instr(column_a,'/',1,1)searches for the first occurance of/instr(column_a,'/',1,2)searches for the second occurance of/the
substrthen extracts everything between the two positions