In my Mysql database I want to update a field fup
for all records which I found using this select statement:
SELECT ic.hash
FROM incompany as ic, app
WHERE ic.id = app.ic_id;
So I created the following combined query:
UPDATE incompany
SET fup = 'x'
WHERE hash IN (SELECT ic.hash
FROM incompany as ic, app
WHERE ic.id = app.ic_id);
But this query gives me the following error:
You can't specify target table 'incompany' for update in FROM clause
Does anybody know how I can make this work? All tips are welcome!