Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Sql question - please reply fast
For the final time Roland.
SQL> select * from mytable;
FIELD1
SQL> get lee.sql
1 SELECT field1, DECODE(field1,'No Info','No Info','Missing
Info','Missing Info',ltrim(substr(field1,1,instr(field1,' ')-1)))
2* FROM mytable
SQL> / FIELD1 DECODE(FIELD1,'NOINF
-------------------- -------------------- Pelle T3333 Pelle No Info No Info Pelle Svensson T3333 Pelle Missing Info Missing Info Kalle S1000 Kalle
SQL> Hope this helps
Lee
-----Original Message-----
Sent: 15 November 2001 06:56
To: Multiple recipients of list ORACLE-L
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: Roland.Skoldblom_at_ica.se
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: ListGuru_at_fatcity.com (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).
The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged. If the reader
of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.
If you have received this communication in error, please
re-send this communication to the sender and delete the
original message or any copy of it from your computer
system.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Robertson Lee - lerobe
INET: lerobe_at_acxiom.co.uk
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: ListGuru_at_fatcity.com (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). Received on Thu Nov 15 2001 - 03:29:43 CST
![]() |
![]() |