MySQL dialect question:
The top x most popular whatever?
One table contains photos (paths to files that is), and one contains rating data on how much people like the pictures.
simplified..
photo:
pid | name | path
777 | lucky | folder/filename.jpg
photo_has_rating:
pid | voteValue | date
777 | 5 | unixDate
777 | 3 | unixDate
777 | 1 | unixDate
Now I want to select the most popular files (limit x), and the most popular files the last week (limit x).
I'll have to count the voteValues and find the top x popular, and then join with photo, and get the names and paths..
|