S
S
sema-fedotov2019-04-17 20:16:30
MySQL
sema-fedotov, 2019-04-17 20:16:30

How to find the sorted row number?

Good evening. There is a rating among users, you need to find the number of the sorted line by rating, thereby the place itself. How to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lazy @BojackHorseman MySQL, 2019-04-17
@sema-fedotov

right in the query is this how it should be done? sort in descending order of rating and, sorting through the records on the client, assign them numbers.
row_number in 8+ versions. at the end of the link article how to get around the lack of window functions in lower versions

A
Axian Ltd., 2017-02-28
@ilshat_gayanov

Pass a variable to a function. If this answer does not suit you, then lightly smoke a book on php.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question