Hi,
I've got a query like this:
SELECT user.*, foto.*, votes.sum(rating) FROM votes WHERE votes.foto_id = foto.fid AND user.id = votes.vote_to_user_id GROUP BY votes.foto_id ORDER BY sum(rating) DESC LIMIT 0 , 10
This query selects photos with the highest sum of votes.
Now I want to exclude photos from the same user.id in this top10. (Because users have more than one photo) So what do I have to add to my query to prevent this from happening?
Thanking you in advance,
ruben.
I've got a query like this:
SELECT user.*, foto.*, votes.sum(rating) FROM votes WHERE votes.foto_id = foto.fid AND user.id = votes.vote_to_user_id GROUP BY votes.foto_id ORDER BY sum(rating) DESC LIMIT 0 , 10
This query selects photos with the highest sum of votes.
Now I want to exclude photos from the same user.id in this top10. (Because users have more than one photo) So what do I have to add to my query to prevent this from happening?
Thanking you in advance,
ruben.