您好,欢迎访问一九零五行业门户网

mysql查询一天一周一个月的数据_MySQL

bitscn.com
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)
查询一个月: 
java代码  
select * from table where date_sub(curdate(), interval 1 month) bitscn.com
其它类似信息

推荐信息