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

Home -> Community -> Mailing Lists -> Oracle-L -> SQL and case structure

SQL and case structure

From: Droogendyk, Harry <Harry.Droogendyk_at_CIBC.com>
Date: Mon, 07 Oct 2002 12:38:55 -0800
Message-ID: <F001.004E2C40.20021007123855@fatcity.com>


Listers:

I've used SAS's version of SQL and it allows the coding of conditional logic in the SELECT statement:

proc sql;
  select acct_no,

     case substr(acct_no,16,1)
       when '1'  then 'one'
       when '2'  then 'two'
       else           'other' 

  end as desc
    from star.kills;
quit;

The same syntax does not work in SQL*Plus for Oracle 8. Can someone point me to the correct syntax?

Secondly, any URLs for this kind of information would be most appreciated.

Regards,
Harry

--

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

Author: Droogendyk, Harry
  INET: Harry.Droogendyk_at_CIBC.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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 Mon Oct 07 2002 - 15:38:55 CDT

Original text of this message

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