MySQL Forums
Forum List  »  Newbie

Re: extract the first 10 catalogs have sold the most...
Posted by: Peter Brawley
Date: December 22, 2021 10:52AM

Read about Group By in the manual.

Is this what you mean?

SELECT catalog, SUM(X) AS Tot
FROM table
GROUP BY Catalog -- correction
ORDER BY Tot DESC
LIMIT 10;



Edited 1 time(s). Last edit at 12/22/2021 11:50PM by Peter Brawley.

Options: ReplyQuote


Subject
Written By
Posted
Re: extract the first 10 catalogs have sold the most...
December 22, 2021 10:52AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.