3
I need to update the last 110 table records relevo
, but my problem lies in the current WHERE
.
I’m doing it this way:
UPDATE relevo
SET id_projeto = 157
WHERE id_relevo = (SELECT id_relevo FROM relevo
ORDER BY id_relevo DESC
LIMIT 110)
The following error is being returned:
You can’t specify target table 'relevo' for update in FROM clause
I tried it this way too:
UPDATE relevo
SET id_projeto = ?
WHERE id_relevo IN (SELECT id_relevo FROM relevo
ORDER BY id_relevo DESC
LIMIT 110)
The error returned:
This version of Mysql doesn’t yet support 'LIMIT & IN/ALL/ANY/SOME subquery
Thank you very much!
– Sabrina T.