Q&A for Ubuntu users and developers
select id, row_number() over (partition by id, upvotes order by upvotes desc) from users order by upvotes desc