drug_sales(product_id, manufacturer, sales)
Return each manufacturer's total sales rounded to the nearest million, as
manufacturer and total_sales_millions, highest first, breaking ties by
manufacturer.
Sum first and round once at the end. Rounding each product before adding them up gives a different answer.
Tables
drug_sales
product_id manufacturer sales
---------- ------------ ----------
1 Acme 600000.00
2 Acme 600000.00
3 Acme 600000.00
4 Borne 5400000.00
5 Cole 2500000.00
Expected result
manufacturer total_sales_millions
------------ --------------------
Borne 5
Cole 3
Acme 2
Sign in to write and run your own code.
SELECT query