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:
- 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
- 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