I have this simple update query:
UPDATE
erif_notify e
SET
e.current_amount = '0.00'
,e._date = now()
WHERE
id IN ( SELECT
en.id
FROM
u_contracts uc
JOIN
erif_notify en
ON
en.contract_id = uc.id
WHERE
uc._status = 7
)
But it gives me such error:
You can't specify target table 'e' for update in FROM clause
Why does it give me this?
I know I can just do it with two separate queries, but can it be done in one?
Thank you in advance.
Here we go…this answer is tested and works:
SAMPLE