I want to add a where clause to the sql below so that the column called “howmany” only shows results that are greater than 1, but I keep getting an error when i try.
select monthname(birthdate) as 'Month', Count(*) as howmany
from tblBday
group by month(birthdate)
;
It’s because you can’t use an alias in a WHERE clause
Also, you can’t do an aggregate function in a WHERE clause
You need something like this
Here’s a tuto about HAVING