MySQL count likes and dislikes
<p>Guys i want to merge two tables. First table is <code>comments</code> and second table is <code>likes</code>. Likes contain likes and dislikes col <code>rate</code> (1 = liked, 2 = disliked)</p>

<p>So i want when i show all comments also i want to add two new cols <code>likes</code> and <code>dislikes</code> where i count how much likes and dislikes has one comment. I do that just for likes but i dont know how to do also for dislikes.</p>

<p>SO here is like table where i save likes:</p>

<pre><code>like_id  item_id  account_id    rate  time                 host    
-------  -------  ----------  ------  -------------------  --------
    308      262           1       1  2016-03-18 13:45:16  (NULL)  
    309      263           1       2  2016-03-18 13:45:33  (NULL)  
    310      262           7       2  2016-03-18 14:23:49  (NULL)  
    311      262           8       1  2016-03-18 14:24:11  (NULL)  
</code></pre>

<p>And here is comment table:</p>

<pre><code>comment_id  item_id   content       account_id     time                 
-------     -------  ----------     ------------  -------------------
  308       262      Test comment      1          2016-03-18 13:45:16  
</code></pre>

<p>So i want to do this result </p>

<pre><code>comment_id  item_id   content    account_id     time    Likes  Dislike         
-------     -------  ---------    ------------  -----  -------- ------
 1           267      test comm        1                 4        2
</code></pre>

<p><strong>My query</strong> </p>

<pre><code>SELECT c.comment_id, acc.account_id, acc.account_firstname, acc.account_lastname,p.photo_name,p.photo_guid, COUNT(_like.item_id) AS likes
FROM pb_account_comments AS c
INNER JOIN pb_accounts AS acc ON acc.account_id = c.account_id
LEFT JOIN pb_account_photos AS p ON p.photo_id = acc.profile_picture_id
LEFT JOIN pb_account_likes AS _like ON _like.item_id = c.comment_id 
WHERE c.item_id = '2' GROUP BY c.comment_id
ORDER BY posted_date ASC LIMIT 0,3;
</code></pre>

<p>My query just count likes and this work good but how can i count and dislikes? </p>