Need Help in mysql syntax for rank functions ! Get A Single user rank in Mysql 5.6

Hello friends i need a help in mysql syntax in rank functions .


This query i get the rank of all user in table
SELECT Name,
Score,
TimeLeft,
@curRank := @curRank + 1 AS rank
FROM Math_Contest_11122019, (SELECT @curRank := 0) r
ORDER BY Score DESC;

Now i want get a single user rank

SELECT MobileNo, Score, TimeLeft, FIND_IN_SET( Score, (
SELECT GROUP_CONCAT( Score
ORDER BY Score DESC, TimeLeft DESC )
FROM Math_Contest_111220119)
) AS rank
FROM Math_Contest_11122019
WHERE MobileNo = 9891582296

this query i get the rank only short score wise not TimeLeft Colum

you might want to ask in a MySQL forum, for example at stackoverflow.com
Newest 'mysql' Questions - Stack Overflow
Taifun

i tried but not get my solution . i get some example but those are not work in MySQL 5.6
so thought i can ask this forum i get help from this forum in rank functions that why i ask also i love kodular and people who used kodular. sorry for my English

this is the Kodular community… so not very much people have an expert knowledge of MySQL here…
what about providing a link to your question in Stackoverflow?

also you might want to elaborate on your question…

Taifun

As Taifun said, what exactly do you need with this query? Do you have an example to show us of a result?

2 Likes