我猜您正在使用SQL Server。如果是这样,您可以在一个查询中完成所有 *** 作:
with toupdate as ( select p.*, row_number() over (partition by fkProductID order by pkProduct) as new_intIssue from dbo.tblProducts p )update toupdate set intIssue = new_intIssue where intIssue <> new_intIssue;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)