Hi all how to do this in MySQL? Returning only records with COUNT > 5?
SELECT `groups`.`groupsDescr`, `roles`.`roles_Agroup`, `roles`.`rolesDescr`, COUNT(`roles`.`rolesDescr`) AS TOTAL FROM `roles` INNER JOIN `groups_roles` ON (`roles`.`rolesID` = `groups_roles`.`fkrolesID`) INNER JOIN `groups` ON (`groups_roles`.`fkgroupsID` = `groups`.`groupsID`) GROUP BY `roles`.`rolesDescr` WHERE COUNT(`roles`.`rolesDescr`) GT 5 MySQL 4.0.12 give an error... maybe because i'm using WHERE COUNT? Thanx for your time. --------------------------------- Crie seu Yahoo! Mail, agora com 100MB de espaço, anti-spam e antivírus grátis!