select* \'form date where
uid = colname and d-time beteeen \'2009-09-01\' and \'2009-11-04\'
select * from xxx where
curdate() between SUBDATE($d-time,INTERVAL 3 DAY) and $d-time
前一星期
select * from xxx where
curdate() between SUBDATE($d-time,INTERVAL 1 WEEK) and $d-time
前一個月
select * from xxx where
curdate() between SUBDATE($d-time,INTERVAL 1 MONTH) and $d-time
前半年
select * from xxx where
curdate() between SUBDATE($d-time,INTERVAL 6 MONTH) and $d-time
2010-09-25 22:24:46 補充
|