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: DECODE question

Re: DECODE question

From: Martin Doherty <martin.doherty_at_elcaro.moc>
Date: Mon, 11 Nov 2002 18:09:29 -0800
Message-ID: <btZz9.18$hW4.277@news.oracle.com>


Doesn't seem to make a lot of sense. The decode is basically saying "If NULL is the same as 'Y' then return acctd_amount_due_remaining else return amount_due_remaining"

Since NULL is never the same as 'Y', the function will always return amount_due_remaining, so the expression may as well have read  "sum(amount_due_remaining)".

Can you provide a bit more context that may help to indicate what the program author was trying to accomplish?

Martin

Josue Batista wrote:

>Given the following two columns:
>
>ACCTD_AMOUNT_DUE_REMAINING NOT NULL NUMBER
>AMOUNT_DUE_REMAINING NOT NULL NUMBER
>
>What does the following statement mean?
>
>sum(decode(NULL,'Y',acctd_amount_due_remaining,amount_due_remaining))
>
>What is the interpretation of the "DECODE(NULL,'Y',..."?
>
>Thanks in advance.
>
>
Received on Mon Nov 11 2002 - 20:09:29 CST

Original text of this message

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