查询 2014年 每月消费额的总数,并排序:
SELECT sum(money),DATE_FORMAT(createtime,"%Y-%m") FROM `salary` where DATE_FORMAT(createtime,"%Y")=2014
group by DATE_FORMAT(createtime,"%m")
ORDER BY DATE_FORMAT(createtime,"%m") ASC;
时间: 2024-11-03 22:07:57
查询 2014年 每月消费额的总数,并排序:
SELECT sum(money),DATE_FORMAT(createtime,"%Y-%m") FROM `salary` where DATE_FORMAT(createtime,"%Y")=2014
group by DATE_FORMAT(createtime,"%m")
ORDER BY DATE_FORMAT(createtime,"%m") ASC;