mysql 查詢當日,昨日,當月,當季度,上一季度和當天某一時間段的數據

test:表名 CreateDateTime:時間字段名 1. 獲取當日的數據 select * from test where to_days(CreateDateTime)= to_days(now()) 2. 獲取昨日的數據 select * from test where to_days(now())-todays(CreateDateTime) <=1 3. 獲取當月的數據 select
相關文章
相關標籤/搜索