Thanks for your reply..
It wont work in my scenario.
As per the example that I have provided above ,
If it is same month I want to show only latest record. For EX: ID - 12 I should show 9/9/2017 record row.
If it is different month I want to show both the records. For EX: ID - 14 I should show 9/17/2017 and 10/15/2017 record rows.