我也试了下,确实不能直接用,只能用临时表完成了SELECT count(*) as c into #t
FROM GameUserInfo group by RegisterIP
Select max(c) From #t这个是用我的数据库实验的.
select max(t1.times)
from
(
select count(*) as times from tableA group by conditionA
) as t1
把结果集起个别名就好了
你用的是内查询,可以这样做:
select top 1 from 表 where exists (select count(*) as times from tableA group by conditionA
oder by times desc)
在末尾加个表别名即可。select max(times)
from
(
select count(*) as times from tableA group by conditionA
) tt
看来还是要依靠自己,其实很简单的修改几句代码就可以搞定,已经成功实现,结贴吧