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

Home -> Community -> Usenet -> c.d.o.server -> Re: Logical operators

Re: Logical operators

From: Gennaro Napolitano <Gennaro.Napolitano_at_italdata.it>
Date: Fri, 11 Jun 1999 16:43:38 +0200
Message-ID: <3761209A.368D72D1@italdata.it>

v_yordanov_at_my-deja.com wrote:

> Is is possible to simulate the IIF() function
> (available in MS-JET) with Oracle, or, more
> generally, to use logical operators inside
> expressions ?

In Oracle you can use the decoded expression. From Oracle documentation:

This expression decodes the value DEPTNO. If DEPTNO is 10, the expression evaluates to 'ACCOUNTING'; if DEPTNO is 20, it evaluates to 'RESEARCH'; etc. If DEPTNO is not 10, 20, 30, or 40, the expression returns 'NONE'.

DECODE (deptno,10, 'ACCOUNTING',
               20, 'RESEARCH',
               30, 'SALES',
               40, 'OPERATION',
                    'NONE')

Ciao Gennaro Received on Fri Jun 11 1999 - 09:43:38 CDT

Original text of this message

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