MySQL查詢本週、上週、本月、上個月份數據的sql代碼

查詢當前這周的數據   SELECT name,submittime FROM enterprise WHERE YEARWEEK(date_format(submittime,'%Y-%m-%d')) = YEARWEEK(now());  查詢上週的數據  SELECT name,submittime FROM enterprise WHERE YEARWEEK(date_format(sub
相關文章
相關標籤/搜索