title: Shortcut multiple Mysql SUMS over intertwined date ranges
body: <p>When a user on my site logs in, multiple queries are performed for stats.</p>
  
  <pre><code>SELECT SUM(earnings) FROM stats WHERE date BETWEEN $start_month AND $end_month
  SELECT SUM(earnings) FROM stats WHERE date BETWEEN $start_last_month AND $end_last_month
  SELECT SUM(earnings) FROM stats WHERE date BETWEEN $start_year AND NOW()
  //etc...
  </code></pre>
  
  <p>I feel that I am "cheating" the Mysql engine by asking it to <code>SUM</code> all of these on separate queries. For example, when it calculates the years earnings it is also calculating the monthly earnings within that...but then I query it again anyways.</p>
  
  <p>Is there a better way to get SUMS for multiple date ranges that are intertwined? </p>