I have data
productcode and cost of each product, i group it by productcode i have total cost of each productcode but i don't have the amount of total cost of every product at the last line, could you help me how to do ?
group by productcode
I need the last line 490 (total of every product)
This is not really the SQL way of thinking to add grand total lines in a report or a data set. What you can do is same the result of your query in a SAS data set (CREATE TABLE ... AS SELECT etc.) and then display the dataset with a PRINT procedure, using the SUM statement to add the final row :
PROC PRINT DATA = queryResult LABEL NOOBS ;
SUM cost ;