Answer the question
In order to leave comments, you need to log in
How to make a sql query whose rating is higher than 3?
Greetings! Please help, how can I select all users whose rating sum (AVG) is more than 3 in total?
there are two tables:
1) ratings:
2) users:
how to get all users who have a rating, average - AVG function > 3?
Tried like this:
SELECT users.*, AVG(ratings.rating) as rate FROM users INNER JOIN ratings WHERE rate > 3;
Answer the question
In order to leave comments, you need to log in
SELECT user_id FROM ratings group by user_id HAVING AVG(rating) > 3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question