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 9213595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:47:07+00:00 2026-06-18T01:47:07+00:00

So I have been trying this for over a week and a bit, I

  • 0

So I have been trying this for over a week and a bit, I put it to rest because I couldn’t get it to work but this is what I am trying to do;

Select a product from the database > Use LEFT OUTER JOIN to load its rating and make an average of it > Use INNER JOINs for different information (not really important, but I will say it anyway).

This is a simplified (but accurate) replica of my query – the original is quite long and has different language words in it so it might get a bit confusing;

SELECT 
PRODUCT.name AS Name,
PRODUCT.price AS Price,
BRAND.name AS Brand,
AVG(RATING.rating) AS Rating
FROM PRODUCT
LEFT OUTER JOIN RATING ON RATING.product_id = PRODUCT.product_id
INNER JOIN BRAND ON BRAND.brand_id = PRODUCT.brand_id
GROUP BY PRODUCT.name, PRODUCT.price, BRAND.name

The above works, but it misses the ‘filtering’ on rating.
I wish adding WHERE AVG(RATING.rating) > 3 would work, but sadly it doesn’t.
Is this in any way possible to do?

Thanks.

  • 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-06-18T01:47:08+00:00Added an answer on June 18, 2026 at 1:47 am

    Try HAVING AVG(RATING.rating) > 3 after your GROUP BY.

    See HAVING on MSDN for more details.

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

Sidebar

Related Questions

I am starting to pull my hair out over this! I have been trying
I have been trying to figure this out for quite a while, but what
I have been trying to get this one section of my UI to immediatly
Well I have been trying this problem for over 10 hours and have no
I have been trying to solve this problem for over 14 hours now...I am
I am trying to figure this out, but its already been a week. Anyone
i have been over so many posts online trying to sort this.... i am
I have been trying this for hours without success. http://replicaisland.googlecode.com/svn/trunk/ I have added the
I've been trying this: NSNumberFormatter *testNumber=[NSNumberFormatter new]; if (![testNumber numberFromString:someNSString]) I have been told
Is there anyone who knows this? I have been trying this for the last

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.