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
You cannot do that in the WHERE clause. The WHERE clause determines which
rows to look at. That is, in this case, it determines which rows to count.
How can it choose which rows to count based on the result of the count?
See the problem?
Instead, you need to use the HAVING clause, which filt