I'm trying to do the following in MySQL:
SELECT DISTINCT field
FROM table
WHERE COUNT(field) > 10
Which fails with: 1111 - Invalid use of group function (from what I understand, you can't use group functions such as COUNT
in the where clause?)
What is the proper way of selecting (distinct) all fields which are present in at least N rows? Is this something I'll have to do externally with say, PHP?
Thanks!