1、主要是利用Having语句进行,由于where不能与聚合函数一起使用,所以用having
SELECT MC,COUNT(MC) AS SL FROM JSB GROUP BY MC HAVING(COUNT(MC)>1)
2、SELECT MC,SL FROM (SELECT MC,COUNT(MC) AS SL FROM JSB GROUP BY MC) WHERE SL>1
1、主要是利用Having语句进行,由于where不能与聚合函数一起使用,所以用having
SELECT MC,COUNT(MC) AS SL FROM JSB GROUP BY MC HAVING(COUNT(MC)>1)
2、SELECT MC,SL FROM (SELECT MC,COUNT(MC) AS SL FROM JSB GROUP BY MC) WHERE SL>1