This is my table. I want to get the url id stored on recently posted dates using mysql query. I have tried the below query
SELECT * FROM T1 GROUP BY url_id having MAX(url_post_date)
Table Name: T1
id url_id url_post_date
-----------------------
1 111 2014-03-14 18:19:59
2 111 2014-03-14 18:20:00
3 112 2014-03-14 19:20:00
4 111 2014-03-14 18:21:00
5 113 2014-03-14 19:21:00
I want the output like:
id url_id url_post_date
-----------------------
5 113 2014-03-14 19:21:00
4 111 2014-03-14 18:21:00
3 112 2014-03-14 19:20:00
Can any one help me would be greatly appreciated.
Thanks.