Unknown column 's.score' in 'having clause' 0.00020 sec error
SELECT
s.name
FROM
student AS s
GROUP BY s.name
HAVING s.score > 80;
因为having 后面只能跟聚合函数所以这样写是错误的。 但是把having改成 where放到group by 后面也是不对的。可以把where和group by换个位置就可以了。。
SELECT
原创
2016-02-15 22:35:56 ·
9844 阅读 ·
5 评论