我知道这是一个简单的语法问题。尝试从子查询中删除所有用户:
delete from users
where id IN (
select u.id
from users u
where not exists (select * from stickies i where i.user_id = u.id)
group by u.email
having count(*) > 1
)
收到此错误:
error : You can't specify target table 'users' for update in FROM clause
子查询工作正常(返回用户 ID 列表)。