Solved

Parsing data in oracle sql using substr

Posted on 2011-03-07
1
377 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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

16 Experts available now in Live!

Get 1:1 Help Now