I want to execute this query:
Select Environment, SUM(Scores) as `Scores`,SUM(Clicks) as `Clicks`
from Example.table
where Scores > sum(Scores)
group by Environment
But it throws the following error:
Aggregate function SUM not allowed in WHERE clause at [4:27]
whereas for the case of having:
having Scores > sum(Scores)
doesn't allow me to keep Scores. What is the right way to implement this?