Wednesday, May 11, 2016

How to bring sentence till the second occurrence of mentioned word

Bu using regular expression it is possible to find sentence till the second occurrence of mentioned word.

select 
regexp_replace('Payables A 2204216 22490587 Payables A 15 2648191', '^(.*)Payables.*$', '\1') p_result
from dual


select 
substr('Payables A 2204216 22490587 Payables A 15 22648191',1
,instr('Payables A 2204216 22490587 Payables A 15 22648191', 'Payables',1,2)-1)  NAMES
from dual;







No comments:

Post a Comment