With a join and group by I think you have HAVING.

>>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.




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to