Tags
MySQL
Asked 7 years ago
24 Aug 2017
Views 1198
jaydeep

jaydeep posted

You can't specify target table 'TABLE_NAME' for update in FROM clause in MySQL

i am trying to rub sub query for update query in MySQL


update   TABLE_NAME set ROW=1 where id in (select id from TABLE_NAME where ROW2='') 

and got error


 You can't specify target table 'TABLE_NAME' for update in FROM clause
Rasi

Rasi
answered Nov 30 '-1 00:00

you can use sub query for select query for same target.

select   * from TABLE_NAME  where id in (select id from TABLE_NAME where ROW2='') 


but no sub query work for update for same target table

Post Answer