Mysql将数据库中重复的数据全部显示出来select a.id,a.name from survey a join ( select name,count(name) from survey group by name having count(name)>1 ) b on a.name=b.name where a.type is null;