I have a table like:
|serialnumber| location | medium |address| date | value
| 320921 | Pomieszczenie C | Gaz | 9 | 2019-12-14 | 547
| 320921 | Pomieszczenie C | Gaz | 9 | 2019-12-16 | 626
| 374836 | Pomieszczenie B | Wodomierz | 5 | 2019-12-28 | 1728
| 374836 | Pomieszczenie B | Wodomierz | 5 | 2020-01-01 | 1998
I want to get the rows with max date, based on a group by serialNumber, result like this:
|serialnumber| location | medium |address| date | value
| 320921 | Pomieszczenie C | Gaz | 9 | 2019-12-16 | 626
| 374836 | Pomieszczenie B | Wodomierz | 5 | 2020-01-01 | 1998
Could you please share your ideas?