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: Mon, 21 Feb 2005 10:39:51 +0100
Message-ID: <37tokaF5gbdcuU1@individual.net>


Paul Izzo wrote:

> I run the following query to find all the records I don't want:
>
> select papp.ARBEITSPLAN_NR,sum(papp.BELEGUNGSEINHEIT_NR)
> from w100.papp,w100.papk
> where papp.ARBEITSPLAN_NR = papk.ARBEITSPLAN_NR
> group by papp.ARBEITSPLAN_NR
> having sum(decode(BELEGUNGSEINHEIT_NR,3400,1,3500,1,3430,1)) != 3

What's wrong with the query i proposed?

   having sum(decode(BELEGUNGSEINHEIT_NR,3400,1,3500,1,3430,1)) = 3    and count(*) = 3

Dieter Received on Mon Feb 21 2005 - 03:39:51 CST

Original text of this message

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