mysql group by having的使用方法

2020 年 9 月 22 日 at 下午 3:28分类:Mysql

查询出test表中,同名个数大于2的所有记录。
select name,count(name) as num from test group by name having count(name)>=2;