I have a SQL query to count the number of rating with at least 15 records and then order them by average rating.
So here is what I came up with:
SELECT name, COUNT(rate) FROM RateTable
WHERE rating = 5
GROUP BY name
HAVING COUNT(rate) > 15
ORDER BY AVG(rate) ASC;
It did actually filtered those product with less than 15 records, however the results is not sorted in order. Any ideas?
Thanks in advance.
EDIT
name Count(rate) AVG(rate) product1 20 5 product2 18 5 product3 17 5