This query is very inefficient, a full table scan will be performed. Best to use (possible index can be used):
select from posts where date between '2012-01-01 00:00:00' and '2012-12-31 23:59:59'
Assumption: date is of type Date (Time)
source
to share