SELECT field1, field2, field3, turnover = SUM(field_to_be_summed)
FROM table
GROUP BY field1, field2 <--- This needs to be name, or id, however you want the sales
aggregated
ORDER BY turnover desc
Go
This will take a little while with 2,000,000 rows to process.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.