I have the below problem:
SELECT
B.ISBN, TITLE, COUNT(Rate) AS NumberOfRatings
FROM
bda.books AS B
LEFT JOIN
bda.booksRatings as BR ON B.ISBN = BR.ISBN
GROUP BY
B.ISBN, Title
I wrote this query, and I want to get only the books with the highest ratings. The only way to do this I found is to add:
HAVING
COUNT(Rate) > 5
As the max values I get is 6. However I do not want to have this hardcoded.