SELECT S.name FROM Student S WHERE S.score > 80 GROUP BY S.name Having count(*)>=2;
SELECT S.name
FROM Student S
WHERE S.score > 80
GROUP BY S.name Having count(*)>=2
没有分组的状况下having和Where 相似。函数
有分组的时候 Where 对分组前内容过滤,having是分组后的内容进行筛选。code
having 里面能够写聚合函数,select
select phone from aa group by phone having count(*) > 1