错误的写法:
delete from test_words where id in (select id from test_words group by word having count(*) = 1)
You can’t specify target table ‘test_words’ for update in FROM clause
套一层就好了,官方规定
正确的写法:
delete from test_words where id in (select id from ( select id from test_words group by word having count(*) > 1) s)