I have the following (shortened query):
SELECT
`Statistics`.`StatisticID`,
COUNT(DISTINCT `Flags`.`FlagType`) AS `FlagCount`
FROM `Statistics`
LEFT JOIN `Flags` ON `Statistics`.`StatisticID` = `Flags`.`StatisticID`
WHERE `FlagCount` = 0
GROUP BY `Statistics`.`StatisticID`
ORDER BY `SubmittedTime` DESC
LIMIT 0, 10
Now, neither FlagCount = 0
or COUNT(Flags.FlagType)
work in the WHERE
clause. I thought about using a SET
but I'm not sure how I'd add that to the query. Any ideas?
Thanks,