#1093 - 您无法指定目标表' new_keyword'用于FROM子句中的更新

时间:2015-08-30 05:58:06

标签: mysql phpmyadmin sql-update

我有这样的查询

 update new_keyword set key_count=key_count-1  where  id in
    (select b.id  from new_keyword b ,new_news a ,new_mudoal_label c where c.label_id=b.id and a.id=c.id and c.type=1 and c.id=186) 

exmple(1,2,3)的子查询返回id 但是mysql显示错误

1 个答案:

答案 0 :(得分:0)

我用这段代码解决了我的问题

update new_keyword set key_count=key_count-1  where  id in
    (select c.label_id  from new_news a ,new_mudoal_label c where  a.id=c.id and c.type=1 and c.id=186)