Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How To Do This In Oracle
I'm not Thomas but:
You can use the AS but it is not needed..
SELECT decode(Paid, 1, NULL, InvoiceAmt) OweAmt,nextfield,etc...
"Adam Wesley" <aw78834_at_hotmail.com> wrote:
>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
>>
>
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! Check out our new Unlimited Server. No Download or Time Limits! -----== Over 80,000 Newsgroups - 19 Different Servers! ==----- Received on Fri Mar 29 2002 - 08:47:50 CST
![]() |
![]() |