My current query is as follows:
SELECT user_id, sum(...) as total from mytable
group by user_id
Which works fine
However when I try
SELECT user_id, sum(...) as total from mytable
group by user_id
having total >= 10
I get an error
SELECT user_id, sum(...) as total from mytable
having total >= 10
Works fine. How can I combine HAVING and GROUP BY?
1 Answer