删除emp_no重复的记录,只保留最小的id对应的记录。

简介

删除emp_no重复的记录,只保留最小的id对应的记录。

DELETE FROM titles_test
where id not in(
    select * from(
        select MIN(id) from titles_test
        group by emp_no
    )as a
)
Hope is a good thing,maybe the best of things,and no good thing ever dies.----------- Andy Dufresne
原文地址:https://www.cnblogs.com/eat-too-much/p/14958082.html