在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

 

posted on 2014-11-26 15:40  梦想&现实  阅读(2282)  评论(0编辑  收藏  举报