Reputation: 127
I have date = 2013-05-08
and a column :
|timestamp
|2013-05-08 21:02:11
|2013-05-08 22:22:21
|2013-05-08 23:05:12
|2013-05-09 11:02:10
|2013-05-10 09:12:01
The result should be :
2013-05-08 23:05:12
How can I achieve that ?
Upvotes: 1
Views: 995
Reputation: 3067
SELECT MAX(timestamp)
FROM table
WHERE DATE(timestamp) = '2015-05-08'
GROUP BY DATE(timestamp);
Upvotes: 3