When I try this in MySQL:
select make,count(*) as num from TABLE where num > 100 group by make
I got:
Error Code: 1054, SQL State: 42S22] Unknown column 'num' in 'where clause'
Is there a way to limit count(*)?
When I try this in MySQL:
select make,count(*) as num from TABLE where num > 100 group by make
I got:
Error Code: 1054, SQL State: 42S22] Unknown column 'num' in 'where clause'
Is there a way to limit count(*)?
You can't put column aliasas in the WHERE
clause. Use a derived table instead:
select make, num
from
(
select make,count(*) as num from TABLE group by make
) dt
where num > 100