总的来说就是要根据emp_no分组然后找到每组id最小的record。

delete from titles_test
where id not in (select * from (select min(id) from titles_test
                                group by emp_no) as temp)
delete from titles_test
where id in (select temp.id from (select *, rank() over (partition by emp_no order by id) as ranking
                             from titles_test) as temp
                             where temp.ranking > 1)