sql - MySQL count row values WHERE column = value -


i have database looks pretty this:

enter image description here

i wanna make mysql query count votes each id , order them starting highest. want output like:

enter image description here

is possible without making 3 queries inside each other?

select     name,     sum(votes) total_votes mytable group 1 order 2 desc 

Comments

Popular posts from this blog

c# - Farseer ContactListener is not working -

Automatically create pages in phpfox -

database - one php page with different contents and urls -