Relative position from 0 to 1.
Section: Ranking functions
Calculate percent rank
sql
sql
SELECT player_id,
score,
PERCENT_RANK() OVER (ORDER BY score) AS pct_rank
FROM leaderboard;Explanation
Great for percentile-style reporting without manual math.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Ranking functions