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: Help with aggregate query

Re: Help with aggregate query

From: Kevin Crosbie <caoimhinocrosbai_at_yahoo.com>
Date: Fri, 15 Apr 2005 09:42:34 +0200
Message-ID: <1113550964.b44d2dae7bd78c48d9786b71e7c53900@teranews>


Randy,

The function that you are looking for which predates CASE is DECODE.

You can say:

SUM(decode(e.xstatus, 'A', 1, 'P', 1, 'X', 1, 0)) as regist

That is the same as the case statement I sent you, i.e. if 'A' then 1
else if 'P' then 1
else if 'X' then 1
else 0

Hope this helps,

Kevin

"Randy Harris" <notvalid_at_no.spam> wrote in message news:OPg7e.2147$bc2.492_at_newssvr17.news.prodigy.com...
> Kevin, I got it working. Thanks very much for the point in the right
> direction.
>
>
Received on Fri Apr 15 2005 - 02:42:34 CDT

Original text of this message

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