- 查询每周、每月等数据SQL写法
``sql SELECT count(1) as total,WEEK(gmt_create) as weeks FROMtask_info` GROUP BY weeks desc
SELECT count(1) as total,MONTH(gmt_create) as months FROM task_info GROUP BY months desc
2. 解决this is incompatible with sql_mode=only_full_group_by的问题```sqlset @@session.sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
