[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 388
  • Last Modified:

Parsing data in oracle sql using substr

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
JDay2
Asked:
JDay2
1 Solution
 
sdstuberCommented:
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now