title: Working with INTERVAL and CURDATE in MySQL
body: <p>I'm building a chart and I want to receive data for each month.</p>
  
  <p>Here's my first request which is working:  </p>
  
  <pre><code>SELECT s.GSP_nom AS nom, timestamp, AVG( v.vote +  v.prix  ) /2 AS avg
  FROM votes_serveur AS v
  INNER JOIN serveur AS s ON v.idServ = s.idServ
  WHERE s.valide =1
  AND v.date &gt; CURDATE() -30
  GROUP BY s.GSP_nom
  ORDER BY avg DESC
  </code></pre>
  
  <p>But, in my case I've to write 12 request to receive data for the 12 previous months, is there any trick to avoid writing:</p>
  
  <pre><code>//  example for the previous month
   AND v.date &gt; CURDATE() -60
  AND v.date &lt; CURDATE () -30
  </code></pre>
  
  <p>I heard about INTERVAL, I went to the MySQL doc but i didn't manage to implement it.</p>
  
  <p>Any example of using INTERVAL please?</p>