首先要分清几个概念1.count() 在SqlServer中式属于聚合函数.聚合函数要求不能出现在where中2.where 可以和 group by连用 但效果和having是不同的 where要求必须在group by 前面..意思是先过滤再分组 而having是必须在group by后面连用 是分组后的过滤 所以过滤条件在什么位置是有很大区别的3.sql中 要求前面有聚合函数和其他字段的,group by中必须把不是聚合函数的字段 加进去
顶一下

(0)
0%
踩一下

(0)
0%
- 相关评论
- 我要评论
-