PDA

View Full Version : maxcount in a row


divinequran
10-15-2009, 05:26 AM
Hi,

How do i select max count of a table in a single query.

Eg:
select type, count(*) as cc, maxcount from t1 group by type;

This is a example query i want the max row count to be printed in the same row. Is it possible?

abduraooft
10-15-2009, 09:31 AM
Try select type, count(*) as cc, (select count(*) from t1 ) as maxcount from t1 group by type;