mysql查詢一天一周一個月的數據 查詢一天: Java代碼 select * from table where to_days(column_time) = to_days(now()); select * from table where date(column_time) = curdate(); 查詢一周: Java代碼 select * from table where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(column_time); 查詢一個月: Java代碼 select * from table where DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= date(column_time);