查询上个月的数据
select name,submittime from enterprise where date_format(submittime,’%Y-%m’)=date_format(DATE_SUB(curdate(), INTERVAL 1 MONTH),’%Y-%m’)
select * from user where DATE_FORMAT(pudate,’%Y%m’) = DATE_FORMAT(CURDATE(),’%Y%m’) ;
select * from user where WEEKOFYEAR(FROM_UNIXTIME(pudate,’%y-%m-%d’)) = WEEKOFYEAR(now())
select * from user where MONTH(FROM_UNIXTIME(pudate,’%y-%m-%d’)) = MONTH(now())
select * from user where YEAR(FROM_UNIXTIME(pudate,’%y-%m-%d’)) = YEAR(now()) and MONTH(FROM_UNIXTIME(pudate,’%y-%m-%d’)) = MONTH(now())
select * from user where pudate between 上月最后一天 and 下月第一天
查询当前月份的数据
select name,submittime from enterprise where date_format(submittime,’%Y-%m’)=date_format(now(),’%Y-%m’)
查询距离当前现在6个月的数据
select name,submittime from enterprise where submittime between date_sub(now(),interval 6 month) and now();
以上关于本文的内容,仅作参考!温馨提示:如遇健康、疾病相关的问题,请您及时就医或请专业人士给予相关指导!
「四川龙网」www.sichuanlong.com小编还为您精选了以下内容,希望对您有所帮助:- 运动专家教你10招 选到最适合的运动鞋
- 教你如何在陌陌聊天 什么是陌陌聊天
- 教你如何消除“将军肚”
- 教你客家有名的蒸肉汤 客家粉蒸肉
- 睡前健身小动作 教你快速入眠
- 保健品批文查询 保健食品批文查询
- 我想查询EMS运单号:EH685684185CN 的货物送到哪里了 ems运单查询
- 08年5月hsk成绩查询 k成绩
- 教你如何制服花心男?花心男最爱9种女人
- 进入感情的倦怠期?教你3个爱情保鲜的妙招