删除表中重复数据

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)
posted @ 2022-07-17 12:13  小大宇  阅读(13)  评论(0编辑  收藏  举报