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
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?
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
Messages: 24975
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: 63951
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.

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

Current Time: Fri Oct 28 11:28:31 CDT 2016

Total time taken to generate the page: 0.11582 seconds