Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORACLE Select and group by excluding one field

956258Aug 16 2012 — edited Aug 17 2012
Dear community,
I have a very simple query (on Oracle 11g) to select 3 fields:

select field1, field2, field3, count(*) from table
where...
group by field1, field2, field3
having count(*) > 10;

Now, what I need, is exclude "field3" from the "group by" since I only need field 1 and 2 to be grouped, but I also need field3 in the output. As far I know, all the fields in the select must be reported also in "group by", so how can I handle that?

Thanks
Lucas
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2012
Added on Aug 16 2012
4 comments
2,853 views