I have to get total number of order by customer , total value for all those orders ,average order value and email . where from -to dates and Country I have mentioned in where clause. This is my table. [Sell-to Customer No_] is customer id.
SELECT
[Sell-to Customer No_]
,[Bill-to Name]
,[Order Date]
,[Amount]
,[Original Order No_]
,[Country]
,[Email]
FROM [TBW_BI].[dbo].[Dreams$Internet Orders]
WHERE [Country]='RUSSIA' and
[order date] >= '2016-11-18T00:00:00.000' AND
[order date] <= '2017-04-10T00:00:00.000'