Split text in Oracle

mrong
mrong used Ask the Experts™
on
Greeting,

I have a txt field with following sample data.

AAA_BB_CCCC
DD_EE_FFF

I need to split it into 2 like the following output.

AAA_BB     CCCC
DD_EE        FFF

Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Distinguished Expert 2018
Commented:
Try this:
select 
     substr(mystr,1,instr(mystr,'_',-1)-1),
     substr(mystr,instr(mystr,'_',-1)+1)
 from mydata

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial