title: How to JOIN a COUNT from a table, and then effect that COUNT with another JOIN
body: <p>I have three tables</p>
  
  <p>Post</p>
  
  <pre><code>ID  Name
  1   'Something'
  2   'Something else'
  3   'One more'
  </code></pre>
  
  <p>Comment</p>
  
  <pre><code>ID  PostId  ProfileID  Comment
  1   1       1          'Hi my name is' 
  2   2       2          'I like cakes'
  3   3       3          'I hate cakes'
  </code></pre>
  
  <p>Profile</p>
  
  <pre><code>ID  Approved
  1   1          
  2   0          
  3   1          
  </code></pre>
  
  <p>I want to count the comments for a post where the profile for the comment is approved</p>
  
  <p>I can select the data from Post and then join a count from Comment fine. But this count should be dependent on if the Profile is approved or not.</p>
  
  <p>The results I am expecting is </p>
  
  <p>CommentCount</p>
  
  <pre><code>PostId  Count
  1       1
  2       0
  3       1
  </code></pre>