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

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -