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: Newbie question on SQL Syntax: using data returned from an aggregate function

Re: Newbie question on SQL Syntax: using data returned from an aggregate function

From: Igor Racic <igor.racicC_at_freesurf.fr_no_C>
Date: Sat, 30 Oct 2004 11:43:39 +0000
Message-ID: <41836184$0$7019$636a15ce@news.free.fr>

Just some quick remarks:

>
> SELECT *
>
> FROM table2
>
> WHERE (table2.field1, table2.field2, table2.field3) in
>
> (SELECT table1.field1, table1.field2, table1.field3, COUNT(*)


                                                        ^^^^^ that makes 
trouble
>
> FROM table1
>
> GROUP BY table1.field1, table1.field2, table1.field3
>
> ORDER BY table1.field1, table1.field2, table1.field3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ you don't need 
that in your subquery (and if needed in your final output - it should go outside )
>
> HAVING COUNT(*) > 1)
>
> Unfortunately, this doesn't seem to work. How do I fix this?
>
>

Hope it helps

Igor Received on Sat Oct 30 2004 - 06:43:39 CDT

Original text of this message

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