I have a rating system and need some help to sort and find the highest rated item.
My table:
votecount - votetotal - voteresult + some misc. colums
1 - 10 - 10
3 - 30 - 10
My system add 1 to votecount every time a vote is made. Add the rating to votetotal and then voteresult = votetotal/votecount.
I select the higest rating with: select * from table ORDER by voteresult DESC limit 1
But if more than one row have the same voteresult it picks the first row it find(or last?).
How do I format my query so it select all from the row with highest voteresult, and if more the one result then sort by votecount?
I hope you can follow my idea. It's bit confused it think.
Regards,
Michael