To calculate a grand total within an SQL query, the keyword available for this purpose is COMPUTE Keyword which is used with out a BY clause
SELECT itemid, Qty, actualPrice, subtotal FROM SalesOrderDetail s WHERE actualPrice< 1000 COMPUTE SUM(Qty), SUM(subtotal)