MySQL Forums
Forum List  »  Newbie

Re: Sorting table and then look for ID
Posted by: Peter Brawley
Date: November 05, 2021 11:47AM

Select from it as a subquery ...

select ... 
from (
  SELECT 
    Id, userName, totalScore,
    Row_Number() OVER w AS 'rank'
  FROM scoreboard_table 
  WINDOW w AS (ORDER BY totalScore DESC) 
) as x
...

Options: ReplyQuote


Subject
Written By
Posted
Re: Sorting table and then look for ID
November 05, 2021 11:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.