Select * from tb where tb_date between cdate(year(now())-month(now())-21) and cdate(year(now())-(month(now())+1)-20)
原理就是用betwenn and 然后就是用时间函数格式化时间。具体怎么整,网上查查吧,我也记不清了。
Select * from tb where tb_date between cdate(year(now())-month(now())-21) and cdate(year(now())-(month(now())+1)-20)
原理就是用betwenn and 然后就是用时间函数格式化时间。具体怎么整,网上查查吧,我也记不清了。