i need ge开发者_开发问答t all data from table, where insert date is befor month or after.
Table:
id Name Date
1 Test2 2010-09-29 10:11:41
2 test4 2010-10-19 11:11:43
3 test4 2011-10-29 11:17:43
Is this what yo uare looking for -
This should give all data with date before a particular month -
SELECT * FROM Table WHERE month(Date) < <number_of_month>
and this should give you all data of date after a particular month -
SELECT * FROM Table WHERE month(Date) > <number_of_month>
精彩评论