title: MySQL query four years ago
body: <p>I happen to have ordered some data for years, I have a column over the years since the dates are not updated in the records. How could inquire to get me records only four years ago?</p>
  
  <p>I tried this way:</p>
  
  <pre><code>$year=date ("Y"); //get the current year
  
  
  $cons="SELECT     iden,
                    ano,
                    wh,
                    so
                    FROM content WHERE wh='n'
                    AND ano BETWEEN 2013 AND".$year ." 
                    ORDER BY ano desc, id DESC";
  </code></pre>
  
  <p>But the problem is that next year I have to modify the query to put 2014 instead of 2013. Had way to mount a conditional subtraction do?</p>
  
  <p>Ano column I have: 2016, 2015, 2014, 2013, etc.</p>
  
  <p>Let's see if I can lend a hand, because I have little knowledge of SQL and would like to learn more. Thank you.</p>