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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How To Do This In Oracle

Re: How To Do This In Oracle

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 28 Mar 2002 17:45:03 -0800
Message-ID: <a80guv0gt3@drn.newsguy.com>


In article <a80fuq$2ke$1_at_slb1.atl.mindspring.net>, "Adam says...
>
>With Microsoft Access, to assign a conditional value to a calculated field I
>use the IIf() function as below:
>
>SELECT Iff([Paid], NULL, [InvoiceAmt])
>

decode( paid,

        1, NULL,
        InvoiceAmt );

that says:

  if (paid = 1) then NULL
  else InvoiceAmt;

>This is interpreted as: if the Paid field value is true, then make the
>calculated field value null (blank); otherwise, make the calculated field
>value the same as the InvoiceAmt field value.
>
>How to do this in oracle? Thanks in advance.
>
>

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Thu Mar 28 2002 - 19:45:03 CST

Original text of this message

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