2022-05-31

Alternative - Error Code: 1093. You can't specify target table 'YOUR_TABLE' for update in FROM clause

 




Error Code: 1093. You can't specify target table 'YOUR_TABLE' for update in FROM clause



UPDATE YOUR_TABLE SET columnA = 'def' WHERE id IN (SELECT id AS MMID FROM YOUR_TABLE WHERE columnA = 'abc');



UPDATE YOUR_TABLE SET columnA = 'def' WHERE id IN ( SELECT MMID FROM ( SELECT id AS MMID FROM YOUR_TABLE WHERE columnA = 'abc' ) AS YOUR_ALIAS );



Google Referrals