title: MYSQL - Selecting the latest 3 records of each stock group
body: <p>stock data</p>
  
  <pre><code>ticker  date         open   high    low     close   volume
  --------------------------------------------------------------
  AAA     2014-06-16   0.9    0.9     0.89    0.895   542
  AAA     2014-06-15   1.32   1.33    1.31    1.32    2792
  AAA     2014-06-14   1.19   1.25    1.19    1.25    417
  AAA     2014-06-13   0.715  0.715   0.705   0.71    36526
  
  BBB     2014-06-16   0.9    0.9     0.89    0.895   542
  BBB     2014-06-15   1.32   1.33    1.31    1.32    2792
  BBB     2014-06-14   1.19   1.25    1.19    1.25    417
  BBB     2014-06-13   0.715  0.715   0.705   0.71    36526
  
  CCC     2014-06-16   0.9    0.9     0.89    0.895   542
  CCC     2014-06-15   1.32   1.33    1.31    1.32    2792
  CCC     2014-06-14   1.19   1.25    1.19    1.25    417
  CCC     2014-06-13   0.715  0.715   0.705   0.71    36526
  </code></pre>
  
  <p>I want to select the latest 3 records of each stock, so that it would return the rows below from the table above like so;</p>
  
  <pre><code>AAA     2014-06-16   0.9    0.9     0.89    0.895   542
  AAA     2014-06-15   1.32   1.33    1.31    1.32    2792
  AAA     2014-06-14   1.19   1.25    1.19    1.25    417
  
  BBB     2014-06-16   0.9    0.9     0.89    0.895   542
  BBB     2014-06-15   1.32   1.33    1.31    1.32    2792
  BBB     2014-06-14   1.19   1.25    1.19    1.25    417
  
  CCC     2014-06-16   0.9    0.9     0.89    0.895   542
  CCC     2014-06-15   1.32   1.33    1.31    1.32    2792
  CCC     2014-06-14   1.19   1.25    1.19    1.25    417
  </code></pre>