title: Two mysql counts with two different where conditions in one query
body: <p>I have a table with two columns namely <code>teacherid</code> and <code>sub_group</code>. Now, sub_group can have values ranging from 0-100 where 0 means lectures for teachers and anything greater than 0 means tutorials. I want to be able to calculate the number of lectures and tutorials grouped by teachers.</p>
  
  <p>So far i have two queries like</p>
  
  <pre><code>SELECT teacherid, count(*) as lectures FROM `ttresponsibility` where sub_group = 0
  group by teacherid
  
  SELECT teacherid, count(*) as tutorials FROM `ttresponsibility` where sub_group &gt; 0
  group by teacherid
  </code></pre>
  
  <p>I want to combine the results of the two into one resultset, something like</p>
  
  <pre><code>teacher    lectures   tutorials
  
  1           15         10
  2           14         8
  </code></pre>
  
  <p>Please suggest...</p>