Home » SQL & PL/SQL » SQL & PL/SQL » regexp and oracle 10g
regexp and oracle 10g [message #313846] Mon, 14 April 2008 21:30 Go to next message
maham_158
Messages: 5
Registered: January 2008
Junior Member
Hi All,

I want to write a query to get all the characters after slash sign using regexp. As a sample i am sending you my input and required output. I know how to get this output using oracle 9i but as now we have shifted to 10g so i have to use regexp.

Input
A
____
12/345
145/89

required output
A
___________
345
89

Best Regards,
Maham
Re: regexp and oracle 10g [message #313848 is a reply to message #313846] Mon, 14 April 2008 21:54 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
>as now we have shifted to 10g so i have to use regexp.
No, you don't have to use regexp.
If you insist that regexp must be used, please proceed to do so.
Re: regexp and oracle 10g [message #313849 is a reply to message #313848] Mon, 14 April 2008 22:00 Go to previous message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
You could use REGEXP_REPLACE; the documentation can be found here.

The expression you are after is '.*/', which means any sequence of characters (.*) followed by a slash.

The rest you can put together yourself as an exercise (that should ensure you go look at that documentation).

Ross Leishman
Previous Topic: Impact of UNION ALL of nearly 10 SQLs on performance ?
Next Topic: Department wise 2 max salary
Goto Forum:
  


Current Time: Thu Dec 08 00:24:25 CST 2016

Total time taken to generate the page: 0.14564 seconds