I have a Vote
domain class from my grails application containing properties like article_id
and note
I want to HQL query the Vote
domain class in order to retrieve the 5 best rated articles having at least 10 votes.
I tried :
SELECT v.article_id, avg(v.note), count(*) FROM vote v where count(*) >= 10 group by v.article_id order by avg(v.note) desc limit 5;
But unfortunately the insertion of where count(*) >= 10
throws an error.
How can I do that in a simple way?
Thank you for your help.