MySQL查詢本週、上週、本月、上個月份的數據

    /*今天*/orm select * from 表名 where to_days(時間字段) = to_days(now());form   /*昨天*/date select * from 表名 where to_days(now())-to_days(時間字段) = 1;select   /*近7天*/數據 select * from 表名 where date_sub(curdate
相關文章
相關標籤/搜索