I've looking for answers but haven't found anything that I could apply to my table, or understand.
I've a table called Vote
with 2 fields idVotant
and idVote
(idVotant
is the guy who made the vote, and idVote
is the guy for who he voted)
If I use this:
SELECT count(idVote) FROM Vote WHERE idVote=6
I get the number of votes that guy n°6 received.
If I use this:
SELECT idVote,count(idVote) AS votes FROM Vote GROUP BY idVote ORDER BY votes DESC
I get the list of all the guys and the number of votes they have.
Now, what I want to do is get the position of each guys, and of a specific one.
The guy n°6 is first because he got more votes, the guy n°2 is second.
And asking the position of a guy like which position is guy n°3 ?