Is there any way to use MySQL to only return an average if there are more than X rows?
I am currently using the following query:
SELECT round(AVG(a_points),1) as a from points where user_id=X
Can this be done in MySQL or do I have to do a row count first then execute this statement?
The table contains
user_id a_points b_points
So a user could have lots of b_points but only 4 a_points and I wouldn’t want to average at that point.
Will it work for you ?
SELECT round(AVG(points),1) as a from points where user_id=X HAVING COUNT(*) >5