Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: extract and strip out last name combined name column

Re: extract and strip out last name combined name column

From: Geoff Muldoon <geoff.muldoon_at_trap.gmail.com>
Date: Thu, 13 Sep 2007 13:43:22 +1000
Message-ID: <MPG.21535ce8db0b0289899d9@news.readfreenews.net>


jobs says...

> How can I strip out and set a persons last name from a column .
>
> I have a column name that will contain names like
>
> John L. Hubbard
> John Doe
> Maria Conchita Alonso
>
> i'd like the name colum to now contain
>
> John L.
> John
> Maria Conchita
>
> and the lastname column to contain
>
> Hubbard
> Doe
> Alonso

select substr(FULLNAME, 1, instr(FULLNAME, ' ', -1, 1)) as NAME,

    substr(FULLNAME, instr(FULL_NAME, ' ', -1, 1)) as LASTNAME from NAMESTABLE;

However, for a name like:
Leonardo Da Vinci
you will get:
NAME: Leonardo Da
LASTNAME: Vinci

... so I don't think that what you want to really achieve can be automatically done.

Geoff M Received on Wed Sep 12 2007 - 22:43:22 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US