update Babies set BirthOrder =tb.sn from Babies b1,
(select ROW_NUMBER() over (partition by familyid order by BirthOrder ) as sn,id,FamilyId,BirthOrder from Babies
where IsDeleted = 0
group by FamilyId,id,BirthOrder
) as tb
where b1.Id=tb.Id

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2021-09-06
  • 2022-12-23
  • 2022-01-16
相关资源
相似解决方案