create table AAA (NAME varchar2(30));
insert into AAA values ('Pelle T3333');
insert into AAA values ('Kalle S1000');
insert into AAA values ('Info missing');
insert into AAA values ('Pelle Svensson T33333');
insert into AAA values ('Bad info');
select decode(name, 'Info missing',NAME,'Bad info',NAME,substr(NAME, 1, instr(NAME, '
', -1)-1)) NAME from AAA;
HTH,
Mike
[EMAIL PROTECTED] píše:
>
> Hej
>
> Would like to have som help with this. Please give me an example of sql statement.
>
> I have field1.
>
> Pelle T3333
> Kalle S1000
> Info missing
> Pelle Svensson T33333
> Bad info
>
> and want this result after the selectstatement.
>
> Pelle
> Kalle
> Info missing
> Pelle Svensson
> Bad info
>
> which means that I dont want to have the last word in this field except
> 'Info missing' and 'Bad info'. These two should remain unchanged, but all other
>should not have the last word .
>
> Thanksin advance
>
> Roland S
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author:
> INET: [EMAIL PROTECTED]
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
--
Ing. Michal Zaschke
DB Administrator
Sokolovska uhelna, a.s.
phone: +420-168-465417
e-mail: [EMAIL PROTECTED]
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Michal Zaschke
INET: [EMAIL PROTECTED]
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).