Skip to Main Content

SQL & PL/SQL

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!

Max, Min and Count with Group By

Heidi WeberNov 17 2013 — edited Nov 18 2013

Hello,

i want the max, min and count of a table, which is grouped by a column

I need a combination of these two selects:

select

     max(COUNTRY_S) MAXVALUE,

     min(COUNTRY_S) MINVALUE

from

     tab_Country

select

     count(*)

from

     (select COUNTRY_TXT from tab_Country group by COUNTRY_TXT) ;

The result should be one row with the max and min value of the table and with the count of the grouped by table, not the max and min of each group! - i hope you understand my question?

Is this possible in one SQL-select?

Thank you very much

Best regards

Heidi

This post has been answered by Frank Kulash on Nov 17 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 16 2013
Added on Nov 17 2013
6 comments
6,158 views