title: Listing both null and not null in mysql query
body: <p>Let's say I have the table</p>
  
  <pre><code>NAME | ID | REF  
  foo1 | 1 | NULL  
  foo2 | 2 | 1234  
  foo2 | 3 | 567  
  foo1 | 4 | NULL  
  foo3 | 5 | 89  
  </code></pre>
  
  <p>I'd like to count all instances of NULL and NOT NULL in one query so that I can say</p>
  
  <pre><code>NAME | null | not null  
  foo1 |  0   |   2  
  foo2 |  2   |   0  
  foo3 |  0   |   1
  </code></pre>
  
  <p>I could run these two queries</p>
  
  <pre><code>select NAME,count(*) from TABLE where REF is not null  
  select NAME,count(*) from TABLE where REF is null
  </code></pre>
  
  <p>But I'm sure there must be a simple way to do it in one mysql query.</p>