title: SQL nested count
body: <p>first: yes i'm a sql noob and i really need some help:</p>
  
  <pre><code>SELECT COUNT(id), SUM(rating), COUNT(rating) FROM comments WHERE phone='$phone';" 
  </code></pre>
  
  <p>this needs to be something like this:</p>
  
  <pre><code>SELECT COUNT(id), SUM(rating), (COUNT(rating) WHERE rating&gt;0) FROM comments WHERE phone='$phone';"
  </code></pre>
  
  <p>Can anyone help out? </p>