I'm struggling with what I thought would be simple. I need to delete some duplicate rows that got created in a table following the release of some buggy code.
The query I've tried is as follows:
delete from buzz where id IN (select distinct b1.id from buzz b1, buzz b2 where b1.id != b2.id and b1.message = b2.message);
The select definitely selects the correct ids that I want to delete, however I get the error
ERROR 1093 (HY000): You can't specify target table 'buzz' for update in FROM clause
I've tried every different thing that I can think of, so now I'm thinking I'm just approaching this the wrong way.
Can someone help?