Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How To Do This In Oracle
Thanks Thomas. But how to name the calculated field?
In Access, I do:
SELECT IIf([Paid], NULL, [InvoiceAmt]) AS OweAmt,
In Oracle:
SELECT decode(Paid, 1, NULL, InvoiceAmt) AS OweAmt, ???
Thanks again in advance.
"Thomas Kyte" <tkyte_at_oracle.com> wrote in message
news:a80guv0gt3_at_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 - 20:48:33 CST
![]() |
![]() |