title: mySql select statment to get last records of duplicate entries
body: <pre><code>ID  Name
  1       A
  2   A
  3   B
  4   C
  5   C
  6   D
  7   F
  8   F
  
  output 1 
  ---------
  ID     Name
  2   A
  5   C
  8   F
  
  output 2
  --------
  ID     Name
  1       A
  3   B
  4   C
  6   D
  7   F
  </code></pre>
  
  <p>I need sql select statement to get output1 and output 2</p>
  
  <p>I need fetch the last entries of duplicate records in output 1 and all rest of the entries in output2 </p>