Home » SQL & PL/SQL » SQL & PL/SQL » Getting a letter after a space (Oracle SQL Plus)
icon5.gif  Getting a letter after a space [message #402402] Sat, 09 May 2009 23:24 Go to next message
antgaudi
Messages: 5
Registered: April 2009
Junior Member
I need to extract every last name starting with the letter 'A'.

The format of the column is like 'Gloria Anderson', 'Olga Swenson'...

Any suggestions?
Thanks.
Re: Getting a letter after a space [message #402403 is a reply to message #402402] Sat, 09 May 2009 23:30 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
produce a simple WHERE clause utilizing LIKE
Re: Getting a letter after a space [message #402414 is a reply to message #402402] Sun, 10 May 2009 00:53 Go to previous message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
INSTR will give you the position of the last space.
SUBSTR will give you the string from this positition (or the next one).

If you are in 10g or up, you can use REGEXP_LIKE and REGEXP_SUBSTR.

Regards
Michel
Previous Topic: Getting Table Hierarchy from a schema
Next Topic: Outer join on a decode value
Goto Forum:
  


Current Time: Fri Dec 09 05:51:50 CST 2016

Total time taken to generate the page: 0.08826 seconds