title: Select rows with minimum date
body: <p><img src="https://i.stack.imgur.com/hfAVo.png" alt="sample data"></p>
  
  <p>How to select row for each Code with minimum date?</p>
  
  <p>The result should be ..</p>
  
  <ol>
  <li>HS00001 2014-01-10</li>
  <li>HS00002 2014-03-10</li>
  <li>HS00003 2014-08-20</li>
  </ol>
  
  <p>P.S.  This is neither H.W. nor Assignment.     I am just trying to create a template in wordpress using php and mysql database.</p>