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: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Tue, 09 Apr 2002 01:16:16 GMT
Message-ID: <Ahrs8.21378$CU.32922@rwcrnsc51.ops.asp.att.net>


You want:
Decode(sign(sum(a.amount)-10000),-1,'Yes',0,'No',1,'No','No') which could be shortened to:(but I like the above since making <= an easy switch)
Decode(sign(sum(a.amount)-10000),-1,'Yes','No')

Jim
"Mark Hamilton" <user_at_user.net> wrote in message news:ub48rmdhd2s3b3_at_corp.supernews.com...
>
> I'm familiar with how to do a DECODE statement like below to find if the
> first letter of 'j.Field' = 'R':
>
> DECODE(substr(j.Field,1,1), 'R', 'Yes', 'No')
>
> A similar function testing for numeric criteria does not work:
>
> DECODE (sum(a.Amount), < 10000, 'Yes','No').
>
> How can I check for numeric criteria in SQL and give substitutions based
on
> the results in a manner similar to DECODE?
>
> Thanks,
>
> Mark Hamilton
>
>
>
>
Received on Mon Apr 08 2002 - 20:16:16 CDT

Original text of this message

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