Solved

substr function

Posted on 2012-04-13
2
483 Views
Last Modified: 2012-06-27
I am trying to achieve the following by using the SUBSTR function,

I have some data as below,

object 1 is XXX-ABXXXX
object 2 is XXX-ABCDEXXXX
object 3 is XXX-ABCDXX

where x is any number from 0 to 9
Now that I want to extract the the trailing X from the three objects I cannot achieve the desired results owing to the different structure of the three objects.


Can anyone suggest if there is a possibility that I can extract the all the trailing X from the three objects so that none of the X is missing. Maybe some check where the char 'D' ends it should start extracting X until the end.

Pls advice.

Regards
0
Comment
Question by:SANbuddies
2 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 37842783
Try this:
select regexp_substr('000-abc123','[0-9]+$') from dual;
0
 

Author Closing Comment

by:SANbuddies
ID: 37843158
Thanks
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Oracle SQL Select Statement 19 58
oracle query 15 63
JDeveloper 12c for 32 bit 4 35
case statement in where clause with not exist 15 35
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

757 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

19 Experts available now in Live!

Get 1:1 Help Now