I have this table
id departure value date
1065 | 2018-09-20 | 10490 | 2018-09-20 18:04:19 |
1034 | 2018-09-25 | 10582 | 2018-09-20 18:04:19 |
1035 | 2018-09-25 | 13096 | 2018-09-20 19:05:19 |
And this consultation
SELECT * FROM departures GROUP BY departure
But doing GROUP BY gives this result:
id departure value date
1065 | 2018-09-20 | 10490 | 2018-09-20 18:04:19 |
1034 | 2018-09-25 | 10582 | 2018-09-20 18:04:19 |
I need that when doing GROUP BY bring the most recent record of the departure field according to the date field and not the first one. That is, it should be in value 13096 and not 10582. I can not have more than one record per date in the departure field.
I can not use subqueries.
I appreciate your help.