MySQL – Using COUNT(*) in the WHERE clause November 24, 2022 by Tarik try this; select gid from `gd` group by gid having count(*) > 10 order by lastupdated desc