hi i have an Mysql table as follow,
post_id | user_id | status | date_created
2 2 funny 20121022120627
2 3 lame 20121023120627
3 1 useful 20121023120627
3 3 lame 20121023120627
3 4 useful 20121023120627
now i need a query on getting a post_id for popular post based on status count.
Means post with many status for the day.Example post_id = 3 will be popular since it has 3 status voted, so i can find the owner of this post on post table.Thanks!!
Try this one,
SQLFiddle Demo
basically, I won’t recomment to use limit here since there are possibilities that certain
Post_IDhas the same number of votes.