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: Group by

Re: Group by

From: Turkbear <john.g_at_dot.spamfree.com>
Date: Fri, 13 May 2005 14:19:34 -0500
Message-ID: <bav98116ff0ufh40npru2n1dbejih240br@4ax.com>


"Cor van Loon" <vanloon_at_planet.nl> wrote:

>Hi,
>
>I''m converting a sql-statement with a 'group by' to Oracle 8i .
>
>Select Tab1.f1, Tab1.fk,
> (select field from Tab2 where tab2.pk=Tab1.fk) as description,
> count(*)
>from Tab1
>group by Tab1.f1, Tab1.fk
>
>Oracle reports an error "ORA-00979 Not a GROUP BY expression"
>As soon as I remove the subquery the statements works fine (but is mis the
>value).
>Does Oracle 8i accepts subqueries as expression in the select-part?
>
>Kind regards,
>
>Cor
>

add
 (select field from Tab2 where tab2.pk=Tab1.fk) as description,[ Maybe just description or just the sub-query]

to your Group By

All columns referenced before the aggregate function must be specified in the Group By clause.( Hence, the 'Not Group By expression' message) Received on Fri May 13 2005 - 14:19:34 CDT

Original text of this message

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