ANY answer.
Re: The top x most popular whatever?
The x most popular ever would be something along the lines:
[sql]SELECT t1.name, sum(t2.voteValue) as totalVotes FROM photo as t1
INNER JOIN photo_has_rating as t2 ON t2.pid = t1.pid
GROUP BY t2.voteValue
ORDER BY totalVotes
LIMIT x[/sql]
If you wanted the the result for the last week you would have to use a WHERE clause
|