删除表中重复数据
delete from t_major
where
speciality in (select speciality from (select speciality from t_major group by speciality having count(speciality) > 1) a)
and
id not in (select pid from (select min(id) as pid from t_major group by speciality having count(speciality) > 1 ) b)