Use HAVING clause instead of a subquery.