I have data as below, I want to select all the records for the particular id having date as latest
Input
patient_id | provider_id | diagnosis_code | service_date |
1 | A | H25.812 | 04-06-2024 |
1 | A | H25.812 | 04-06-2024 |
1 | A | H25.812 | 04-06-2024 |
1 | A | H25.813 | 19-03-2024 |
1 | A | H25.813 | 19-03-2024 |
Output
patient_id | provider_id | diagnosis_code | service_date |
1 | A | H25.812 | 04-06-2024 |
1 | A | H25.812 | 04-06-2024 |
1 | A | H25.812 | 04-06-2024 |
This is just the partial data, but the main ask is to get all the latest date records wrt to each patient id.
This is required a little urgently.
Thanks
Solved! Go to Solution.
@Maanvendra one way of doing this
Thanks for the quick reply both of you,
Both the solution are acceptable and give the required output