Solved

Parsing data in oracle sql using substr

Posted on 2011-03-07
1
378 Views
Last Modified: 2012-05-11
Trying to parse data in a field

data has the following C3,5,35

need it to look like this

Repair Code1     Repair Code 2      Repair Code 3
C3                        5                         35

select
REGEXP_SUBSTR (NVL (historical_separate.work_done, active_separate.work_done),'[^,]+') "Repair Code1",  What are the next statements to get repair code 2 and repair code 3?

Thanks.



0
Comment
Question by:JDay2
1 Comment
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 35060436
REGEXP_SUBSTR( nvl(historical_separate.work_done, active_separate.work_done),'[^,]+') "Repair Code1",
REGEXP_SUBSTR( nvl(historical_separate.work_done, active_separate.work_done),'[^,]+',1,2) "Repair Code2",
REGEXP_SUBSTR( nvl(historical_separate.work_done, active_separate.work_done),'[^,]+',1,3) "Repair Code3"
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Query Syntax Error 9 49
mySQL Syntax 7 34
Consolidating oracle query results to a single line 8 53
Optimizing a query 3 34
As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

861 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now