title: Getting the last record in SQL in WHERE condition
body: <p>i have <code>loanTable</code> that contain two field <code>loan_id</code> and <code>status</code>   </p>
  
  <pre><code>loan_id status
  ==============
  1       0
  2       9
  1       6
  5       3
  4       5
  1       4  &lt;-- How do I select this??
  4       6
  </code></pre>
  
  <p>In this Situation i need to show the last <code>Status</code> of <code>loan_id</code> 1 i.e is <code>status</code> 4. Can please help me in this query.</p>