title: How to select max date value while selecting max value
body: <p>I have the following sample from a table with students results with date for a school entry exam
  <a href="https://i.stack.imgur.com/j6SDf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j6SDf.png" alt="enter image description here" /></a></p>
  <p>First student passed exam - This is the most common record found for most students</p>
  <p>Second student failed 1st time entry and passed second time based on the date</p>
  <p>3rd student had a failed input entry and was corrected based on the Version
  <a href="https://i.stack.imgur.com/0Yp5L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Yp5L.png" alt="enter image description here" /></a></p>
  <p>I need the results to like like the picture above, so we take into regard using the latest date and highest version!</p>
  <p>My basic query thus far is</p>
  <pre><code>select studentid 
  ,examdate --(Date)   
  ,result -- (charvar)
  from StudentEntryExam
  </code></pre>
  <p>How should I approach this issue?</p>