社区
MS-SQL Server
帖子详情
update 语句中不能用别名吗?
mahongxi
2005-05-19 11:42:15
update t wfSteps t set t.id = 0 where t.id = 0 -- 不行
update wfSteps t set t.id = 0 where t.id = 0-- 不行
update wfSteps set id = 0 where id = 0 --OK
...全文
1140
13
打赏
收藏
update 语句中不能用别名吗?
update t wfSteps t set t.id = 0 where t.id = 0 -- 不行 update wfSteps t set t.id = 0 where t.id = 0-- 不行 update wfSteps set id = 0 where id = 0 --OK
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
13 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
mahongxi
2005-05-20
打赏
举报
回复
昏.
haonanernet
2005-05-20
打赏
举报
回复
可以用
Navywang917
2005-05-20
打赏
举报
回复
update t set id = 0 from wfSteps t where id = 0
paoluo
2005-05-19
打赏
举报
回复
别名必须在Update之后
update t set t.id = 0 from wfSteps t where t.id = 0
RainYang
2005-05-19
打赏
举报
回复
update tp
set id=0
from wfSteps tp
where id=0
這樣就OK
这个对
Well
2005-05-19
打赏
举报
回复
當然可以用啊
update tp
set id=0
from wfSteps tp
where id=0
這樣就OK
dazhu2
2005-05-19
打赏
举报
回复
别名申明要放后面吧
dazhu2
2005-05-19
打赏
举报
回复
试一下
xiaomeixiang
2005-05-19
打赏
举报
回复
哦,寫錯了,應該這樣寫
update t set id = 0 from wfSteps t where id = 0
xiaomeixiang
2005-05-19
打赏
举报
回复
update t set t.id = 0 where t.id = 0 from wfSteps t
zjcxc
元老
2005-05-19
打赏
举报
回复
--这种应该是ACCESS支持的用法
update wfSteps t set t.id = 0 where t.id = 0-- 不行
zjcxc
元老
2005-05-19
打赏
举报
回复
update t set id = 0 from wfSteps t --别名这样用法
where id = 0 --OK
lypzl
2005-05-19
打赏
举报
回复
学习
sql
中
的
Update
语句
为什么
不能
用表的
别名
本文详细解析了SQL
Update
语句
的规范写法,并通过实例指出常见错误及解决办法,旨在帮助开发者避免常见错误,提升代码质量。
SQLServer更新
语句
要注意
本文解释了在 SQLServer
中
UPDATE
语句
为何
不能
使用表
别名
,并提供了正确的语法示例。通常的做法是在 FROM 子句
中
指定表而非直接在
UPDATE
关键字后使用表
别名
。
mysql
中
You can‘t specify target table ‘table‘ for
update
in FROM clause解决方案
文章讲述了在SQL更新
语句
中
,由于
不能
在同一
语句
中
同时使用目标表进行SELECT和
UPDATE
操作,作者提出通过为SELECT
语句
创建
别名
来解决这个问题。
mysql之You can't specify target table 'XXX' for
update
in FROM clause
本文解析了在MySQL
中
遇到的“Youcan'tspecifytargettablefor
update
inFROMclause”错误,详细说明了为何
不能
在同一
语句
中
先SELECT再
UPDATE
同一张表,并提供了使用
别名
修正该错误的方法。
DELETE
语句
本文介绍了在SQL
中
如何使用子查询进行删除操作,强调了
不能
直接在同一个
语句
中
先SELECT后
UPDATE
,而是需要通过派生表来实现。同时,展示了在DELETE
语句
中
使用
别名
的方法,确保了SQL
语句
的正确执行。
MS-SQL Server
34,876
社区成员
254,638
社区内容
发帖
与我相关
我的任务
MS-SQL Server
MS-SQL Server相关内容讨论专区
复制链接
扫一扫
分享
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章