我有从2003年Q3到2005年Q2销售人员订单数量的数据,我想显示每个季度的结果,销售人员和前5名销售人员的总订单数量。
我有一条sql语句
select DATEPART (Year, [Order Date]) AS Year,
DATEPART (QUARTER,[Order Date]) As Quarter,
Salesperson,
SUM([Order Amount]) As [Total Order Amount]
from dbo.tbl_sales
Group By DATEPART (YEAR, [Order Date]