如果您有一个带有 SALES {Customer_ID, Price, SmallDateTime date}
的表格.您如何报告每月的所有销售额?
If you have a table with SALES {Customer_ID, Price, SmallDateTime date}
. How do you report all sales per month?
SELECT Sum(Price) As Total Sales FROM SALES Group By What Having What
SELECT YEAR(date) as SalesYear,
MONTH(date) as SalesMonth,
SUM(Price) AS TotalSales
FROM Sales
GROUP BY YEAR(date), MONTH(date)
ORDER BY YEAR(date), MONTH(date)
这篇关于每月总销售额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!