Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT gallery_id,a.b/gallery_vote_sum c , (gallery_vote_rating*gallery_vote_sum - (gallery_vote_sum-a.b)*IF(gallery_vote_rating>7,10,1))/a.b d, a.b, gallery_vote_sum, gallery_vote_balls, gallery_vote_rating FROM gallery_galleries, (SELECT vote_gallery_id, COUNT(*) b FROM gallery_votes GROUP BY 1) a WHERE a.vote_gallery_id = gallery_id AND a.b/gallery_vote_sum < 0.5 ORDER BY 2 DESC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement