title: Counting the same column of different value sets in a single group by clause
body: <p>I have a table (SQLite DB) like this,</p>
  
  <p><code>CREATE TABLE parser (ip text, user text, code text);</code></p>
  
  <p>Now I need to count how many <code>code</code> have a value of either <code>1, 2, or 3</code>, and how many are not, group by <code>ip</code> field.</p>
  
  <p>But as far as I can go, I can't do this altogether, but with two SQL phrases.</p>
  
  <p>e.g </p>
  
  <pre><code>select count(*) as cnt, ip 
  from parser 
  where code in (1, 2, 3) 
  group by ip 
  order by cnt DESC 
  limit 10
  </code></pre>
  
  <p>And a <code>not in</code> query.</p>
  
  <p>So, can I merge the two queries into a single one?</p>