题解 | #不能一边查一边把要查的表给删了#
删除emp_no重复的记录,只保留最小的id对应的记录。
https://www.nowcoder.com/practice/3d92551a6f6d4f1ebde272d20872cf05
delete from titles_test
where id not in (
select * from (
select min(id)
from titles_test
group by emp_no
) a
)
不能一边查一边把要查的表给删了。