I have two tables which having master child relationship.
Master table:
master Id | Name 
  1       | name1
  2       | Name2
Child Table:
ChildId| MasterId | Detail |
  1    |  1       | det01  |
  2    |  1       | det02  |
  3    |  2       | det03  |
  4    |  2       | det04  |  
  5    |  2       | det05  |   
What I want:
ChildId| MasterId | Detail |
  5    |  2       | det05  |
  2    |  1       | det02  |
this table is ordered by ChildId desc but having a single record against a MasterId. please let me know how to achieve this target.
 
     
     
    