>
> 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
>
>
> Using MySQL give me an error. how to do that?
All those backticks give me a headache & probably MySQL too.
GT isn't SQL, it's CFML.
Most importantly, you need to GROUP BY the columns that *aren't* referenced
in aggregate functions (eg COUNT), not the ones that are.
Nick
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]