Thanks for the feedback and help, at least I thought of different approaches. I came up with something that does not depend on which version of SQL Server I use (our provider often changes versions, so I have to be as cross-compatible as possible).
(, ), , :
SELECT company
, product
, price
FROM companyMaster
ORDER BY company,
, product,
, price
UNION
SELECT company + 'Total'
, ''
, SUM(price)
FROM companyMaster
GROUP BY company
ORDER BY company;
UNION select. , , . , ( "Total" ), , , Total ,
( , , , :
CompanyA Product 7 14.99
CompanyA Product 3 45.95
CompanyA Product 4 12.00
CompanyA Total 72.94
CompanyB Product 3 45.95
CompanyB Total 45.95
CompanyC Product 7 14.99
CompanyC Product 3 45.95
CompanyC Total 60.94