select count(1) from (select * from aaa where rownum<101) awhere a.zt='2'group by a.zt
declare @cnt intselect @cnt=count(*) from tableprint(@cnt)
select count(zt) from (select top 100 * from table )b where zt='2'