title: Counting total and true condition lines
body: <p>How to count the number of lines in a table and the number of lines where a certain condition is true without resorting to subselects like this:</p>
  
  <pre><code>create table t (a integer);
  insert into t (a) values (1), (2), (null);
  
  select
      (select count(*) from t) as total_lines,
      (select count(*) from t where a = 1) as condition_true
  ;
   total_lines | condition_true 
  -------------+----------------
             3 |              1
  </code></pre>