Possible Duplicate:
SQL Delete: can't specify target table for update in FROM clause
I'm trying to delete some rows, but is currently not in success.
DELETE FROM product_pictures
WHERE picture = (SELECT picture FROM product_pictures WHERE id = ?)
You can't specify target table 'product_pictures' for update in FROM
clause
I've never seen this error message before, nor has I been able to find some useful info about what I'm doing wrong.
Example of rows:
ID Picture
19 picture-grey.jpg
20 picture-grey.jpg
21 picture-grey.jpg
or:
Your query has a loop in it. Why don't you just do
This cheat will fool mysql analyzer