I need to remove rows where there is a duplicate link column from a table. I'm trying to run:
delete from resultitem
where id in (select r.id
from resultitem r
group by r.link
having count(r.id) >1);
But getting an error:
ERROR 1093 (HY000): You can't specify target table 'resultitem' for update in FROM clause
Is this possible to remove rows by subquery in MySQL without a temporary table? Please advise.