Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Subquery Question

Re: Subquery Question

From: Dieter Nöth <dnoeth_at_gmx.de>
Date: Fri, 18 Feb 2005 14:27:07 +0100
Message-ID: <37m8qcF5e4uv9U1@individual.net>


Paul Izzo wrote:

> I tried your original suggestion with SUM and I don't get anything in
> return. I replaced SUM with DECODE and the syntax is wrong. Here's
> what I tried:
>
> select papp.ARBEITSPLAN_NR
> from w100.papp
> group by ARBEITSPLAN_NR
> having
> decode(case when papp.BELEGUNGSEINHEIT_NR in (3400,3500,3430)
> then 1 end) = 3
> and count(*) = 3
>
> I don't think that I can use CASE because I'm running a 8i database.
> SUM and DECODE are supported on 8i though.

Haven't worked with Oracle for several years, but IIRC:

     sum(decode(BELEGUNGSEINHEIT_NR, 3400,1,3500,1,3430,1)) = 3

Dieter Received on Fri Feb 18 2005 - 07:27:07 CST

Original text of this message

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