分组后产生序号,并将序号赋值
with T as (
select TemplateID,phaseID,orderNum,Row_number() over(partition by TemplateID,substring(phaseID,0,len(phaseID)-2) order by phaseID ) As orderNum2 from TemplatePhaseConfig
)
update T set orderNum=orderNum2
现在的几乎什么都不懂,但是不代表以后的我也是这样。