U
U
utyfua2016-02-08 22:15:03
PHP
utyfua, 2016-02-08 22:15:03

Get the position of a row in a selection?

There is a request for selection in a DB on a rating, let's say. I need to know the position of a string with a known id. It is possible by a bulkhead in php, but I'm interested in the method through the database itself.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2016-02-08
@utyfua

Find the rating for that id, then count `COUNT(*) AS POSITION WHERE rating > MyRating` how many rows with a higher rating.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question