MySQL: Getting a row number (ranking) for a specific row

前端 未结 3 435
刺人心
刺人心 2020-12-31 21:31

I have a users table that has a column called money_sent. I want to order this table by money_sent in descending order, and then find

3条回答
  •  一整个雨季
    2020-12-31 22:01

    SELECT Row,user, money_sent
    FROM (SELECT @row := @row + 1 AS Row, user, money_sent 
           FROM table1 order by money_sent desc) 
    As derived1 
    

提交回复
热议问题