title: Show entries that I have in common with an user, seperated by likes and dislikes
body: <p>I have a page system like the one on facebook where every user can like or even dislike a page. <code>status = 1</code> is a like, <code>0</code> is a dislike.</p>
  
  <p>This is my query:</p>
  
  <pre><code>SELECT  
  p.title_de, de, p.keyname, l.status,
  (CASE WHEN l.status = '1' THEN title_de END) AS liked,
  (CASE WHEN l.status = '0' THEN title_de END) AS disliked
  FROM pages_likes l  
  JOIN pages p on p.id = l.page_id 
  WHERE  p.keyname != 'rship'  AND l.uid = '311'  
  GROUP BY l.page_id  
  ORDER BY p.title_de ASC
  </code></pre>
  
  <p>Questions:</p>
  
  <p>1) I also want to count all liked and disliked entries by that user. At the moment I wrote an extra query for that but I wonder if it would be more efficient to implement that count in that query already? I tried to use <code>COUNT</code> but then I only get one result back from the whole query.</p>
  
  <p>2) I want to display common/mutual likes I have with this user (<code>uid</code> means user_id). I tried to add an <code>AND 'uid' = 1</code> to <code>WHERE</code> but that didn't work. This should also be seperated by likes and dislikes (<code>status = 1</code> and <code>0</code>). I suppose I should write a subquery with <code>UNION</code>? But I don't know how exactly.</p>
  
  <p>This is my structure:</p>
  
  <p><a href="https://i.stack.imgur.com/lx8TF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lx8TF.jpg" alt="enter image description here"></a></p>