Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 830807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:06:17+00:00 2026-05-15T04:06:17+00:00

I have a Vote domain class from my grails application containing properties like article_id

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:06:17+00:00Added an answer on May 15, 2026 at 4:06 am

    Not being able to test it, I’m reluctant to try to guess how the final query would look like, but HAVING COUNT(*) >= 10 might be something to look at.

    http://www.sqlcommands.net/sql+having/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a model called Vote and this is what vote.rb looks like: class
I have an website where people can place a vote like this: http://mysite.com/vote/25 This
I have a class called Deal. Deal has vote_scores. I would like to see
I have two classes in Grails application , Employee has hasMany(one To Many relations)
I have a vote model with like, dislike actions. I have a route for
I have a vote model, which has a class method called score . Basically,
I have a model Vote , and I'm using an after_validation callback. class Vote
The domain is like this: class Poll(db.Model): question = db.StringProperty() ... class Choice(db.Model): poll
Let's say I have the following classes: class Votable(models.Model): name = ... class Vote(models.Model):
Hi I have sql code like that: SELECT vote_id, (SELECT type FROM vote_types WHERE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.