Zoho COQL: Group by with Order by

Zoho COQL: Group by with Order by

Hi

I'm trying to group products by their description and then get the top selling product. My current query is:


  1. select Product_Name.Category.Name as Description, SUM(Quantity) as Total from {module} where (Created_Time between '{start_date}' and '{end_date}') group by Product_Name.Category.Name

The query works well it brings the desired result. Now I'd like to get the TOP one, so I tried to order by 

  1. select Product_Name.Category.Name as Description, SUM(Quantity) as Total from {module} where (Created_Time between '{start_date}' and '{end_date}') group by Product_Name.Category.Name order by Total

But it does not work. Neither does "order by SUM(Quantity)" Is there a workaround for this?

Thanks