我想在2013年对击球率和总体进行排名,但不确定该功能:
Select playerID, yearID, Batting_average, teamID, lgID
RANK() OVER (ORDER BY Batting_average DESC) AS BattingAverageRank
From Material_Batting
where yearID = 2013
order by Batting_average;
尝试RANK ( ) OVER ( [ partition_by_clause ] order_by_clause )
,但没有工作
答案 0 :(得分:0)
试试这个:
SELECT playerID
,yearID
,Batting_average
,franchName
,rank() OVER (ORDER BY batting_average DESC) Batting_average_rank
FROM Material_Batting
WHERE yearID = 2013
ORDER BY Batting_average