update 的一种用法
2008-09-18 16:44 金色海洋(jyk) 阅读(902) 评论(0) 编辑 收藏 举报declare @aa int
set @aa = 1
update EWC_HT_Contract set ContractCode = a.ContractCode + cast (@aa as nvarchar(10)),@aa = @aa +1
from
(
select ContractCode from Contract
WHERE (MasterID = 1)
) as a
where MasterID = 2
set @aa = 1
update EWC_HT_Contract set ContractCode = a.ContractCode + cast (@aa as nvarchar(10)),@aa = @aa +1
from
(
select ContractCode from Contract
WHERE (MasterID = 1)
) as a
where MasterID = 2
SQL Server 2000 里面的通过记录修改另一条记录地方法,还可以修改序号。