between SUBDATE(SUBDATE(CURDATE(),14),DATE_FORMAT(SUBDATE(CURDATE(),14),'%w')-8) and DATE_ADD(SUBDATE(SUBDATE(CURDATE(),14),DATE_FORMAT(SUBDATE(CURDATE(),14),'%w')-8),INTERVAL 6 DAY)
好的!谢谢
select date_sub(date_sub(date_format(now(),'%y-%m-%d'),interval extract(day from now())-1 day),interval 1 month);
这个语句要怎么优化成取上个月的语句,只保存年和月的