title: postgresql - sql - count of `true` values
body: <pre><code>myCol
  ------
   true
   true
   true
   false
   false
   null
  </code></pre>
  
  <p>In the above table, if I do :</p>
  
  <pre><code>select count(*), count(myCol);
  </code></pre>
  
  <p>I get <code>6, 5</code></p>
  
  <p>I get <code>5</code> as it doesn't count the null entry.</p>
  
  <p>How do I also count the number of true values (3 in the example)?</p>
  
  <p>(This is a simplification and I'm actually using a much more complicated expression within the count function)</p>
  
  <p>Edit summary: I also want to include a plain count(*) in the query, so can't use a where clause</p>