SQL语句统计天天、每个月、每一年的 数据

一、每一年 select year(ordertime) AS '年', sum(Total) '销售合计' from order_list group by year(ordertime) 二、每个月 select year(ordertime) '年', month(ordertime) '月', sum(Total) '销售合计' from order_list group by year
相关文章
相关标签/搜索