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
相關文章
相關標籤/搜索