delete from titles_test
where id not in (
select * from (
select min(id) from titles_test
group by emp_no) as n
);
MySQL不允许一边查询一边删除,需要将第一次查询的结果重命名,然后进行二次查询。
delete from titles_test
where id not in (
select * from (
select min(id) from titles_test
group by emp_no) as n
);
MySQL不允许一边查询一边删除,需要将第一次查询的结果重命名,然后进行二次查询。