title: Get the highest value of the last 7 days with SQL
body: <p>I would like to fetch the highest value (from the column named value) for the 7 past days. I have tried with this sql:</p>
  
  <pre><code>SELECT MAX(value) as value_of_week 
  FROM events 
  WHERE event_date &gt; UNIX_TIMESTAMP() -(7 * 86400);
  </code></pre>
  
  <p>But it gives me 86.1 that is older than 7  days from today´s date. Given the rows below, I should get 55.2 with date 2014-05-16 07:07:00.</p>
  
  <pre><code>id  value   event_date
  1   28.     2014-04-18 08:23:00
  2   23.6    2014-04-22 06:43:00
  3   86.1    2014-04-29 05:32:00
  4   43.3    2014-05-03 08:12:00
  5   55.2    2014-05-16 07:07:00
  6   25.6    2014-05-19 06:11:00
  </code></pre>