Suppose having query
SELECT c_id, id, max(date) as max_date FROM table
GROUP BY c_id,updated
And following result:
c_id, id, max_date
1 5 2017-12-28 16:09:20
1 6 2019-12-28 16:09:20
2 7 2017-12-28 16:09:20
2 8 2019-12-28 16:09:20
I expect to get:
c_id, id, max_date
1 6 2019-12-28 16:09:20
2 8 2019-12-28 16:09:20
How to achieve that in mysql 5.7?