mysql查询员⼯上⽉绩效_MySQL查询本周、上周、本⽉、上
个⽉份数据的sql代码(转)...
------------------------------------------------------------------------------
MySQL查询的⽅式很多,下⾯为您介绍的MySQL查询实现的是查询本周、上周、本⽉、上个⽉份的数据,如果您对MySQL查询⽅⾯感兴趣的话,不妨⼀看
六角恐龙>spa怎么做查询当前这周的数据
SELECT name,submittime FROM enterpri WHERE YEARWEEK(date_format(submittime,'%Y-%m-%d')) =
YEARWEEK(now());
查询上周的数据SELECT name,submittime FROM enterpri WHERE YEARWEEK(date_format(submittime,'%Y-%m-%d')) = YEARWEEK(now())-1;
查询当前⽉份的数据lect name,submittime from enterpri where date_format(submittime,'%Y-%m')=date_format(now(),'%Y-%m')
蟹爪兰花
查询距离当前现在6个⽉的数据
lect name,submittime from enterpri where submittime between date_sub(now(),interval 6 month) and now();
查询上个⽉的数据
开塞露说明书lect name,submittime from enterpri where date_format(submittime,'%Y-%m')=date_format(DATE_SUB(curdate(), INTERVAL 1 MONTH),'%Y-%m')
脑瘤是怎么形成的隔离霜排行榜前十名的牌子lect * from `ur` where DATE_FORMAT(pudate,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m') ;
灰色关联分析法
lect * from ur where WEEKOFYEAR(FROM_UNIXTIME(pudate,'%y-%m-%d')) = WEEKOFYEAR(now())
lect *
竹鸡养殖from ur
where MONTH(FROM_UNIXTIME(pudate,'%y-%m-%d')) = MONTH(now())
lect *
from [ur]
where YEAR(FROM_UNIXTIME(pudate,'%y-%m-%d')) = YEAR(now())
and MONTH(FROM_UNIXTIME(pudate,'%y-%m-%d')) = MONTH(now())
lect *
from [ur]
where pudate between 上⽉最后⼀天
and 下⽉第⼀天