[thelist] mysql UPDATE SELECT query

kasimir-k kasimir.k.lists at gmail.com
Tue Apr 1 10:20:10 CDT 2008


Bojan Tesanovic scribeva in 2008-04-01 16:34:
> update ads set img_1_small= (select  img_1_small from ads where  
> id=37) where img_1_small is NULL;
> 
> 
> but mysql return
> Error Code : 1093
> You can't specify target table 'ads' for update in FROM clause

 From <http://dev.mysql.com/doc/refman/5.1/en/update.html> the last line:
"Currently, you cannot update a table and select from the same table in 
a subquery"

.k



More information about the thelist mailing list