update 表
set TopGoodsLineID=OldLineID where TopGoodsLineID=499
order by ID
set TopGoodsLineID=OldLineID where TopGoodsLineID=499
order by ID
解决方案 »
- A(a,b,c) a为key,B(x,b,c) x为key,现将表A的记录集插入B表中的SQL语句如何写:
- 帮忙看一下,高分(100)在线等
- 一个关于数据类型的问题
- 普通的PC上安装SQL2005企业版,提示“处理器类型不支持该安装包”,PC是DELLOPTIPLEX 755,CPU为Intel Core2 2.4GHz
- 以jdbc方式连接SQLServer,获取每个Connection对象都需要15秒,求解
- 删除数据库的Transact-SQL 语句
- 数据筛选!疑感…………
- 急救呀!存储过程声明变量的问题!小第不才!
- 用SQL修改表的列名?
- 这段程序在一个页面执行出错,但在另一个程序中成功,我找不出原因?烦啊!
- 我建立了一个表,表中的一些字段是不能为空的,但现在我想把这个表中的所有内容都清空,请问怎么办
- 判断缴费是否过期。在线等,急急!!谢谢!!
where TopGoodsLineID=a.ID AND TopGoodsLineID = 499
set TopGoodsLineID=a.ID
from (select ID,OldLineID from tb where OldLineID=499)a
where TopGoodsLineID=a.OldLineID AND TopGoodsLineID = 499
from tablename t1,tablename t2
where t1.topgoodslineid=t2.oldlineid
服务器: 消息 8154,级别 16,状态 1,行 6
表 'process_mission_child' 不明确。update process_mission_child
set topgoodslinid = t2.id
from
process_mission_child t1,process_mission_child t2
where
t1.topgoodslineid=t2.oldlineid
ID, TopGoodsLineID, OldLineID
525, 0, 515
526, 515, null
527, 515, null
528, 515, null
529, 0, 519
530, 519, null
531, 519, null
532, 519, null
目标:
ID, TopGoodsLineID, OldLineID
525, 0, 515
526, 525, null
527, 525, null
528, 525, null
529, 0, 519
530, 529, null
531, 529, null
532, 529, null
set TopGoodsLineID=a.ID
from (select ID,OldLineID from process_mission_child where OldLineID is not null)a
where TopGoodsLineID=a.OldLineID and process_mission_child.OldLineID is null
xinbeckham:你和hahai9451是不是好朋友啊?这么急?:)