日期:2014-05-19  浏览次数:20459 次

这个SQl语句怎么写?
我现在使用了group   by   分组统计某信息语句如下

select   count(*),name!   from   table   group   by   name2

现在,我想得到最大的count(*),可是,用了好多方法,用SQL语句就是不成功。各位高手帮忙下~

------解决方案--------------------
select top 1 count(*),name2 from table group by name2 order by count(*) desc
------解决方案--------------------
select top 1 * from (select count(*) as cs,name! from table group by name2) t order by cs desc