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