获得综合排名

Get Overall Rank

我 运行 下面 sql 服务器脚本来检索一些数据,但我需要添加列来告诉我在每个 LEAGUE 中哪个用户是第一个,第二个等等

Select 

(Select Name From League Where ID = League_Details.League_ID) As League
,Player
,(Select Total From AllUserPoints Where User_ID = Player) As Total


 From 
     League_Details

Where 
     LeagueType = 'Private'

order by League

这是结果:

您必须在此语句中正确使用 order by。 试试这个:

Select (Select Name From League Where ID = League_Details.League_ID) As League
,Player, (Select Total From AllUserPoints Where User_ID = Player) As Total

 From 
     League_Details

Where 
     LeagueType = 'Private'

order by League, Total desc

试试这个,让我知道它是否适用。