您的位置:首页 > 其它

学习关于聚合FUNCTION(count(*|fieldname))

2006-09-21 15:47 281 查看
-----------------结果集为刚好分组后每组中记录数为3个
select * from b t
where (select count(*) from b where a = t.a and b > t.b) <3
and exists(select count(*) from b where a=t.a group by a having count(*)>=3)
go
----------------结晶集为分组后每组中记录数为》=3个
select *
from b t
where exists(select count(*) from b where a=t.a group by a having count(*)>=3)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐