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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Ang: RE: komplex sql

Re: Ang: RE: komplex sql

From: <nlzanen1_at_EY.NL>
Date: Wed, 14 Nov 2001 05:19:16 -0800
Message-ID: <F001.003C4752.20011114045520@fatcity.com>

Hi,

Lookup the substr, instr, decode etc... functions in the fine manual. Excellent source for this kind of information

Jack

Go-ahead and start flaming!!!

Roland.Skoldblom_at_ica.se_at_fatcity.com on 14-11-2001 13:25:20

Please respond to ORACLE-L_at_fatcity.com

Sent by: root_at_fatcity.com

To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc: (bcc: Jack van Zanen/nlzanen1/External/MEY/NL)

But if I have this field1

Kenny Jenny A1000
Jenny L1000
No info
Missing Info

I would have:
Kenny Jenny
Jenny
No info
Missing Info

How do I solve this: I just want the last word in the field to betaken away in the select statement.

Roland

Robertson Lee - lerobe <lerobe_at_acxiom.co.uk>@fatcity.com den 2001-11-14 03:50 PST Sänd svar till ORACLE-L_at_fatcity.com

Sänt av: root_at_fatcity.com

Till: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> Kopia:

SELECT DECODE(field1,'No Info','No Info','Missing Info','Missing Info',ltrim(su
bstr(field1,1,instr(field1,' ')-1)))
FROM mytable

This works I have ran it myself. eg.

SQL> @lee

FIELD1 DECODE(FIELD1,'NOINF
-------------------- --------------------

Jimmy J1000          Jimmy
No Info              No Info
Timmy J1000          Timmy
Missing Info         Missing Info



Roland, I don't mean to be harsh, but can I politely suggest that you get yourself either booked on or self study Oracle Basics.

It seems that when someone provides you with a solution to a problem, rather
than press ahead and solve the rest of it yourself you merely ask another question. For example, your previous question to this was how to get "No info" selected. Next you ask how to get "Missing Info" as well.

Logic suggests that you merely repeat the solution you were given for the previous question re. "No Info".

Sorry if I appear to be giving a lecture here but of late it seems that you are throwing questions to the list without taking anytime to think about them yourself.

Regards

Lee

-----Original Message-----

Sent: 14 November 2001 10:50
To: Multiple recipients of list ORACLE-L

Hallo,

How can I do a select statement that creates this:

I have the field1

Jimmy Y1000
Timmy L33333
No Info
Missing Info

and I want the select to give me this:

Jimmy
Timmy
No Info
Missing Info

You see It should still be 'No info' and 'Missing Info'after the select statement.

How can I change this statement?

SELECT ltrim(substr(mxurval_namn,instr(mxurval_namn,' '))) FROM mxurval;

Thanks in 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).

--

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).

De informatie verzonden in dit e-mailbericht is vertrouwelijk en is uitsluitend bestemd voor de geadresseerde. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze informatie aan derden is, behoudens voorafgaande schriftelijke toestemming van Ernst & Young, niet toegestaan. Ernst & Young staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden e-mailbericht, noch voor tijdige ontvangst daarvan. Ernst & Young kan niet garanderen dat een verzonden e-mailbericht vrij is van virussen, noch dat e-mailberichten worden overgebracht zonder inbreuk of tussenkomst van onbevoegde derden.

Indien bovenstaand e-mailbericht niet aan u is gericht, verzoeken wij u vriendelijk doch dringend het e-mailbericht te retourneren aan de verzender en het origineel en eventuele kopieën te verwijderen en te vernietigen.

Ernst & Young hanteert bij de uitoefening van haar werkzaamheden algemene voorwaarden, waarin een beperking van aansprakelijkheid is opgenomen. De algemene voorwaarden worden u op verzoek kosteloos toegezonden.



The information contained in this communication is confidential and is intended solely for the use of the individual or entity to whom it is addressed. You should not copy, disclose or distribute this communication without the authority of Ernst & Young. Ernst & Young is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. Ernst & Young does not guarantee that the integrity of this communication has been maintained nor that the communication is free of viruses, interceptions or interference.

If you are not the intended recipient of this communication please return the communication to the sender and delete and destroy all copies.

In carrying out its engagements, Ernst & Young applies general terms and conditions, which contain a clause that limits its liability. A copy of these terms and conditions is available on request free of charge.


--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: nlzanen1_at_EY.NL

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 Wed Nov 14 2001 - 07:19:16 CST

Original text of this message

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