Issue
i made query to display the count of total number of positive and negative but i need to get or display only the maximum count of either positive or negative.this is my query
SELECT count(`sentiment`) as count,`sentiment` FROM `sno_social_listener` WHERE `keyword_id` = 104 group by `sentiment`
Solution
ORDER BY
and LIMIT
should be what you're looking for.
SELECT count(`sentiment`) as count,
`sentiment`
FROM `sno_social_listener`
WHERE `keyword_id` = 104
GROUP BY `sentiment`
ORDER BY count DESC
LIMIT 1
Answered By - pavel
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.