Hi how can I restrict my select statement on a count()?
I have this query
SELECT a, count(b) as c FROM table WHERE c>5 GROUP BY a
which returns a
ERROR 1054: Unknown column 'a' in 'where clause'
I've also tried
select list_id, count(unique_id) from hitdetail where count(unique_id)>3 group by list_id;
which gives me
ERROR 1111: Invalid use of group function
I know I can use count values in some places because I can happily order by them, however, I am having difficulty using them in a where condition.
Answer on a postcard
Thanks
Bubble