There is a query I've just made
SELECT *
FROM users
INNER JOIN ratings ON ratings.rateable=users.id
ORDER BY SUM(ratings.rating)/COUNT(ratings.rating)
But, it doesn't work, I just get one person in result, although there are 3 people in ratings table! I'm using php 5.
I think sum(), count() doesn't work at all! Please, help!! Cause I can't understand how to build TOP RATED system.