mysql select last week posts count

by Prakash 2013-08-03 12:49:45

In mysql to select the last 7 days posts or its count the following query is used.


select count(*) from posts where date > DATE_SUB(NOW(), INTERVAL 7 DAY)


In the above query date is the user defined column specifying the date.

Tagged in:

463
like
0
dislike
0
mail
flag

You must LOGIN to add comments