How can I write a sql statement which returns the latest record per day, per an Id. Eg. with the data as below.
Id Name Comment Value DateTime
1 Tim Test 100 02/06/2020 15:05:12
2 Sue House 200 03/06/2020 08:25:01
1 Tim Test 150 02/06/2020 18:05:12
3 Doug Cars 680 10/05/2019 04:45:10
2 Sue Tennis 200 03/06/2020 10:35:15
I'd get :
Id Name Comment Value DateTime
1 Tim Test 150 02/06/2020 18:05:12
3 Doug Cars 680 10/05/2019 04:45:10
2 Sue Tennis 200 03/06/2020 10:35:15
Would I need a sub-select query which groups by the max date time?