Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: sql Query problem
> Title GivenNames FamilyName
> ----- ---------- ---------
> Mr Kim Gary Jones
>
> what i need returned is
>
> Mr K. Jones
>
> I need only the first initial and there to be only 1 space between the
> MR the K. and Jones
>
I'm not sure I understand correctly what you want to explain but if your problem is to extract only the first letter or a column just use "substr" ORACLE function and concatenate by a double pipe a dot after this function. "lpad" ORACLE function just remove trailer spaces.
And the SQL select will be :
SELECT LPAD(title)||' '||substr(givennames,1,1)||'. '||familyname FROM <your table>
And you will obtain "Mr K. Jones" as the result
feel free to send me a email for further explanation.
Pascal BRENNER
LGS Europe / Paris / France
Phone Number : 33 1 46 12 64 97
EMail : pbrenner @ lgs-europe.fr
![]() |
![]() |