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: Numeric comparison in DECODE statement

RE: Numeric comparison in DECODE statement

From: Jamadagni, Rajendra <Rajendra.Jamadagni_at_espn.com>
Date: Mon, 20 May 2002 08:08:36 -0800
Message-ID: <F001.00464A4A.20020520080836@fatcity.com>


You can also implement your logic as

SELECT DECODE(SIGN(in_value-60),

              -1, TO_CHAR(in_value)||' minutes', 
              TO_CHAR(in_value/60, '9.99')||' hours')
  FROM dual
/

HTH
Raj



Rajendra Jamadagni MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.

QOTD: Any clod can have facts, but having an opinion is an art!

-----Original Message-----
Sent: Monday, May 20, 2002 11:38 AM
To: Multiple recipients of list ORACLE-L

Robert,

    That won't work. Decode works like a switch statement. If condition 1 then
value 1. You can't imbed logic operators therein.

DickG.


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jamadagni, Rajendra
  INET: Rajendra.Jamadagni_at_espn.com

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 Mon May 20 2002 - 11:08:36 CDT

Original text of this message

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