mssql sqlserver update delete表别名用法简介

转自:http://www.maomao365.com/?p=6973 

摘要:
在sql脚本编写中,如果需要在update delete 中使用表别名的方法,必须按照一定的规则编写,否则将会出现相应的异常信息,如下所示:
实验环境:sqlserver 2008 R2


 

---update 表别名的写法
update [别名] set [别名].[字段] =[字段值] from [表名] as [表别名] where [条件]
---delete 表别名的写法
delete [别名] set [别名].[字段] =[字段值] from [表名] as [表别名] where [条件]
 

 

posted @ 2018-08-04 22:37  Adeal2008  阅读(1409)  评论(0编辑  收藏  举报