您的位置:首页 > 博客中心 > 数据库 >

SQLServer更新语句要注意

时间:2022-03-14 03:02

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

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

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

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

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

 

参考:

 

参考

 

热门排行

今日推荐

热门手游