首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

sql更新数据不能有from的异常解决方案

2012-07-22 
sql更新数据不能有from的错误解决方案You cant specify target table tbl_total_log for update in FRO

sql更新数据不能有from的错误解决方案

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


update tbl_total_log set unassigned = unassigned - 199 where id = (select id from (select max(id) id from tbl_total_log) tbl_temp);Query OK, 1 row affectedRows matched: 1  Changed: 1  Warnings: 0


select * from tbl_total_log where id = (select id from (select max(id) id from tbl_total_log) tbl_temp);1 row in set



http://www.xaprb.com/blog/2006/06/23/how-to-select-from-an-update-target-in-mysql/

热点排行