Solved

Split text in Oracle

Posted on 2014-03-05
1
397 Views
Last Modified: 2014-03-05
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.
0
Comment
Question by:mrong
1 Comment
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 39906494
Try this:
select 
     substr(mystr,1,instr(mystr,'_',-1)-1),
     substr(mystr,instr(mystr,'_',-1)+1)
 from mydata

Open in new window

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sql help 2 46
Sum particular field in database 2 16
Help with Oracle IF statment 5 26
grant privilege to execute a procedure for user in another database 20 23
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question