I have data in my table as below
date ID value
20210109 12 234
20210131 12 456
20210225 23 4567
20210228 23 567
20210315 56 456
20210326 45 3435
20210328 45 4567
20210327 56 12345
My result should be
date ID value
20210131 12 456
20210228 23 567
20210328 45 4567
20210327 56 12345
There could be more ID values for each month but I need the value for the max date for that (id, maxdate). What is the most efficient way to write this query?