I need to run a SQL UPDATE query like below
UPDATE table_1
SET field_1 = value_1
WHERE field_2 IN (
SELECT t1.field_2
FROM table_1 AS t1
,table_2 AS t2
WHERE t2.field_3 = value_2
AND t1.field_2 = t2.field_2
);
But the issue is its is howing error like-
You can't specify target table 't1' for update in FROM clause
When I am running sub-query alone and putting its reslut in main query, then I am getting the results. Can anyone help?
Thanks in advance