mysql怎么查询上一周的数据
发布网友
发布时间:2022-05-23 06:12
我来回答
共2个回答
热心网友
时间:2023-04-29 07:42
查询当前这周的数据
SELECT name,submittime FROM enterprise WHERE YEARWEEK(date_format(submittime,'%Y-%m-%d')) = YEARWEEK(now());
查询上周的数据
SELECT name,submittime FROM enterprise WHERE YEARWEEK(date_format(submittime,'%Y-%m-%d')) = YEARWEEK(now())-1;
查询当前月份的数据
select name,submittime from enterprise where date_format(submittime,'%Y-%m')=date_format(now(),'%Y-%m')
热心网友
时间:2023-04-29 07:42
改时间啊when start_time and end_time