You want to get the rank in MySQL. Here is one approach:
SELECT id, name, @rn := @rn+1 as `rank`
from `users` cross join (select @rn := 0) const
ORDER BY points desc
More Related Contents:
- left join query keep a column empty
- How to do a regular expression replace in MySQL?
- Rank function in MySQL
- Count the number of occurrences of a string in a VARCHAR field?
- MySQL 8.0 – Client does not support authentication protocol requested by server; consider upgrading MySQL client
- Can’t connect to MySQL server error 111 [closed]
- How to import a CSV file into a MySQL table
- How to store arrays in MySQL?
- Include headers when using SELECT INTO OUTFILE?
- ERROR 1130 (HY000): Host ” is not allowed to connect to this MySQL server [duplicate]
- How do I select between the 1st day of the current month and current day in MySQL?
- Subqueries with EXISTS vs IN – MySQL
- MySQL timezone change?
- Cronjob or MySQL event?
- How to insert BLOB and CLOB files in MySQL?
- 60 million entries, select entries from a certain month. How to optimize database?
- How to start spring-boot app without depending on Database?
- Is it possible to GROUP BY multiple columns using MySQL?
- MySQL compare DATE string with string from DATETIME field
- MySQL monthly Sale of last 12 months including months with no Sale
- Can MySQL FIND_IN_SET or equivalent be made to use indices?
- How to fuzzy match email or telephone by Elasticsearch?
- How can I use transactions in my MySQL stored procedure?
- MySQL: LAST_INSERT_ID() returns 0
- MySQL – select data from database between two dates
- Calculating a Moving Average MySQL?
- What are the optimum varchar sizes for MySQL?
- Can MySQL use multiple indexes for a single query?
- ERROR 1044 (42000): Access denied for ‘root’ With All Privileges
- Does replace into have a where clause?