title: Count boolean field values within a single query
body: <p>I like to get the amount of rows where a certain field is either 1 or 0.</p>
  
  <p>My table looks like this:</p>
  
  <pre><code>ID | name | my_bool
  ===================
   1 | foo  | 1
   2 | bar  | 1
   3 | loo  | 0
   4 | zoo  | 1
  </code></pre>
  
  <p>as result I expect</p>
  
  <pre><code>YES | NO  | percentage
  ======================
   3  | 1   | 0.3333
  </code></pre>
  
  <p><code>YES</code> is how many rows where <code>my_bool</code> is <strong>true</strong> (1) while <code>NO</code> is where rows with <strong>false</strong> (0)</p>
  
  <p><code>percentage</code> give the percentage of <code>YES</code> to <code>NO</code></p>