34,594
社区成员
发帖
与我相关
我的任务
分享
select count(*)from (select max(b),c from table group by c)
create table #test(a int, b varchar(10), c varchar(10))
insert into #test
select 1,'bbb','ccc'
union all select 2, 'bbb', 'ccc'
select max(b),c from #test group by c
select @@rowcount
-----------
1
(1 行受影响)
--
select count(*)
from (select max(b),c from table group by c)t