SQLServer更新语句要注意

在SQLServer中 update语句中对于表不能使用别名

eg:update table a set a.column="" where ...

这样在SQLServer中是不对(在oracle中可以),不能对表使用别名,这是为什么呢?

这是因为我们一直写的update更新语句都是简写过的,实际上正确的应该是这样的:

 update t set t.Column='' from table t where ...

参考:http://blog.csdn.net/zyzlywq/article/details/6753648

参考http://www.cnblogs.com/KevinYang/archive/2010/07/09/1774063.html

原文地址:https://www.cnblogs.com/mengzhixingping/p/4123430.html