title: How to get distinct results with max of a field
body: <p>I have a query :</p>
  
  <pre><code>select distinct(donorig_cdn),cerhue_num_rfa,max(cerhue_dt) from t_certif_hue 
  
  
   group by donorig_cdn,cerhue_num_rfa 
  
  
   order by donorig_cdn 
  </code></pre>
  
  <p>it returns me some repeated ids with different cerhue_num_rfa 
  <a href="https://i.stack.imgur.com/g3PNI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g3PNI.png" alt="2451 2460 2467 are repeated"></a></p>
  
  <p>how do i return only one line for the repeated ids with cerhue_num_rfa that matches the max of date (cerhue_dt) .. and have at the end only 10 results instead of 15 ?</p>