I have the following dataset:
| id | id_rev | time |
|---|---|---|
| 1 | 1 | 08.01.2022 |
| 1 | 0 | 31.02.2021 |
| 2 | 2 | 28.01.2017 |
| 2 | 1 | 25.07.2021 |
| 2 | 0 | 25.07.2021 |
I am looking for a SQL query that can return an entry per id but only the one where the id_rev is maximum. So in this case it should return these two rows:
(id=1, id_rev=1,time) (id=2, id_rev=2, time)