if you have something like this:
votes
1
2
1
2
1
3
2
1
2
you want something like this
votes total
1 4
2 4
3 1
The query is like this:
SELECT votes,count(votes) as total from table group by votes order by total desc,votes asc
Note: in the order by, some databases use the alias while others use the expression in select, so if doen't works, try count(votes) instead of total in the ORDER BY clause. I don't know how mysql works cause i didn't work in it in the last 15 months. Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com