Forum Moderators: open
For some reason the score is giving me just a minus version of the comments. The votes.score field contains numbers 1 or -1 only. Any help?
Thanks in advance :-)
SELECT quotes.*, SUM(votes.score) AS score, COUNT(comments.id) AS comments FROM quotes LEFT JOIN votes ON quotes.id = votes.quoteid LEFT JOIN comments ON quotes.id = comments.quoteid GROUP BY quotes.id ORDER BY quotes.id DESC LIMIT 10
It gives comments as 5 and score as -5 instead of comments as 5 and score as +1 :-s