I'm doing a query in the database, follow my table below
id | valor | mes | ano |
1 39.69 3 2017
1 7.69 3 2018
3 9.69 4 2015
3 3.69 2 2016
2 5.89 3 2017
2 39.69 8 2018
I need to bring the result by grouping the values by the last value of the month and year,
that is, I need the result like this:
id | valor | mes | ano |
1 7.69 3 2018
3 3.69 2 2016
2 39.69 8 2018