title: MySQL select records for the past 3 months
body: <p>what will be the smartest way to select all rows from MySQL table for the past 3 months if the table has the following columns:</p>
  
  <pre><code>| id (int) | year (int)| month (int) |
  </code></pre>
  
  <p>Considering that if the current month &amp; year are for example <strong>2.2016</strong>   I need to select all records for 11.2015 &amp; 12.2015 &amp; 1.2016</p>
  
  <p>It is easy if the current month is greater than 3 because all months that I need to select are in the same year so I can subtract 3 from the current month and run simple query </p>
  
  <pre><code>SELECT * FROM mytabe where year=2016 and month &gt;= xx
  </code></pre>