Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Subquery Question
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