title: SQL Query with coalesce inside join and subquery returning null
body: <p>My Query is returning null where I would like a 0. I think it has something to do with the coalesce being inside of the subquery but I cannot get anything to change. the query in question: </p>
  
  <pre><code>SELECT c.post_id, c.post_name, c.post_content, c.post_datetime, c.user_name, 
      p.like_count, 
      p.dislike_count, 
      s.comment_count
  FROM posts c 
      LEFT JOIN (
         select post_id, 
                sum(like_count) like_count,
                sum(dislike_count) dislike_count
         from post_likes
         group by post_id
      ) p ON c.post_id = p.post_id 
      LEFT JOIN (
         select post_id, COALESCE(sum(comment_count),0) comment_count
         from comments
         group by post_id
      ) s ON c.post_id = s.post_id 
  WHERE c.user_name = 'test' 
  </code></pre>
  
  <p>It is returning the correct sum but COALESCE seems to have no affect.</p>