Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: extract and strip out last name combined name column
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
![]() |
![]() |