This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 求MS-SQLSERVER SQL 语句
-bobo123(bobo);
2005-10-14
{584}
(#2552732@0)
-
UPDATE branchMaster set charterNumber = 22, branchId = branchId + (SELECT MAX(branchId) FROM branchMaster WHERE charterNumber = 22) WHERE charterNumber = 21
-guestagain(guest again);
2005-10-14
(#2553132@0)
-
对不起,我提的问题不清楚,导致误解其实我是想写个存储过程
MergeBranchMaster
(@From_CharterNumber int ,@To_CharterNumber int)
在上贴的例子中,@From_CharterNumber=21,@To_CharterNumber=22
另外除了知道CHARTERNUMBER 和BRANCHID 是键值外,BRANCHID 的值事先是不可知的,有可能其他的BRANCHID 原来就没按顺序排列,但希望合并后,能够对BRANCHID 重新排序,值为1,2,3,。。。
-bobo123(bobo);
2005-10-14
{334}
(#2553740@0)