我有以下表格:
Rank RankTies TeamName WinningPercentage
TeamA 1000
TeamB 1000
TeamC 500
TeamD 250
TeamE 250
TeamF 250
TeamG 0
我想使用存储过程按照WinningPercentage降序排列这些数据,更新后的表格应该是:
Rank RankTies TeamName WinningPercentage
1 2 TeamA 1000
1 2 TeamB 1000
3 1 TeamC 500
4 3 TeamD 250
4 3 TeamE 250
4 3 TeamF 250
7 1 TeamG 0
我可以通过临时表来实现这一点,但是否有更优雅的解决方案,例如一条UPDATE语句?