1)按天统计:
select DATE_FORMAT(start_time,'%Y%m%d') days,count(*) count from xx group by days;
2)按周统计:
select DATE_FORMAT(start_time,'%Y%u') weeks,count(*) count from xx group by weeks;
3)按月统计:
select DATE_FORMAT(start_time,'%Y%m') months,count(*) count from xx group bymonths;
年月日 时分秒:DATE_FORMAT(start_time,'%Y%m%d %h%i%s')
加1秒: update t_test set update_time=date_add(update_time, interval 1 second) where 1=1 减1秒: update t_test set update_time=date_sub(update_time, interval 1 second) where 1=1