mysql - #1093 - You can't specify target table 'cps' for update in FROM clause -


i trying update records select

but got error #1093 , code

update `tabcategories_products`  set`categories` = 'cat00001'  `categories` =  'cat00108' ,  `parent` not in (  select  `parent`   `tabcategories_products`   `categories` !=  'cat00108'  ) 

mysql not allow update on select , solution such case there thing select update ?

thanks

wrap query in in clause in query :

select t.*  (     select  `parent`       `tabcategories_products`       `categories` !=  'cat00108') ) t 

this subquery creates implicit temporary table t , doesn't count table updating.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -