title: Getting total average between dates
body: <p>I have a table named <code>sales</code> with the following format.</p>
  
  <pre><code>sale_id         user_id          sale_date              sale_cost
  j847bv-6ggd     bd48ta36-cn5x    2017-01-10 15:43:12    30
  vf87x2-15gr     bd48ta36-cn5x    2017-01-05 13:41:16    60
  3gfd7f-2cdd     8g4f5ccf-1fet    2017-01-15 14:10:12    100
  4bgfd5-12vn     8g4f5ccf-1fet    2017-01-20 19:47:14    20
  b58e32-bf87     8g4f5ccf-1fet    2017-01-20 17:35:13    15
  bg87db-127g     gr4gg1f4-3gbb    2017-01-20 12:26:15    80
  </code></pre>
  
  <p>How could I get the average amount that a user (<code>user_d</code>) spends within the first X amount of days since their first purchase? I don't want an average for every user, but a total average for all.</p>
  
  <p>I know that I can get the average using <code>select avg(sale_cost)</code> but I'm unsure how to find out the average for a date period.</p>