What is thesql command to list the total sales by customer , month , and product, with subtotals by customer and by month and a grand total for all product sales

Respuesta :

Baraq

Answer:

The answer is below

Explanation:

The the sql command to list the total sales by customer , month , and product, with subtotals by customer and by month and a grand total for all product sales is:

SELECT S.CUS_CODE, T.TM_MONTH, S.P_CODE,

SUM(S.SALE_UNITS*S.SALE_PRICE) AS "TOTSALES"

FROM DWDAYSALESFACT AS S INNER JOIN DWTIME AS T ON S.TM_ID =

T.TM_ID

GROUP BY S.CUS_CODE,T.TM_MONTH,S.P_CODE WITH ROLLUP;

ACCESS MORE
EDU ACCESS
Universidad de Mexico