title: making a combined sum of two columns
body: <p>I have a table (apples) containing:</p>
  
  <pre><code>cid  date_am date_pm 
  ----------------------
  1      1       1
  2      2       1
  3      1       3  
  1      1       2
  </code></pre>
  
  <p>I asked a question earlier (badly) about how I would rank the customers in order of the number of ones(1) they had. The solution was (based on one column):</p>
  
  <pre><code>SELECT cid, sum( date_pm ) AS No_of_ones
  FROM apples
  WHERE date_am =1
  GROUP BY cid
  ORDER BY no_of_ones DESC 
  </code></pre>
  
  <p>This works great for one column but how would I do the same for the sum of the two columns.
  ie. </p>
  
  <pre><code>SELECT cid, sum( date_pm ) AS No_of_ones
  FROM apples
  WHERE date_am =1
  add to
  SELECT cid, sum( date_am ) AS No_of_ones
  FROM apples
  WHERE date_pm =1
  GROUP by cid
  ORDER by no_of_ones(added)
  </code></pre>
  
  <p>hope I've managed to make that clear enough for you to help -thanks </p>