title: append last 3 date entries for each row and id mysql
body: <p>I'm currently doing this logic outside of SQL, but it takes forever. Is it possible to do this with SQL to speed it up?</p>
  <p>I have data:</p>
  <pre><code>id    date          
  1     2020-01-01
  1     2019-08-01
  1     2018-06-01
  1     2018-03-01
  2     2020-04-01
  2     2020-07-01
  </code></pre>
  <p>Every row has an ID and date column.</p>
  <p>For every row in this table, I want to append the previous 3 dates for that id.</p>
  <p>So the output in this example would be:</p>
  <pre><code>id    date0         date1         date2         date3
  1     2020-01-01    2019-08-01    2018-06-01    2018-03-01 
  1     2019-08-01    2018-06-01    2018-03-01    
  1     2018-06-01    2018-03-01    
  1     2018-03-01   
  2     2020-04-01    2020-07-01
  2     2020-07-01
  </code></pre>
  <p>Is this possible?</p>