Subqueries aren't supported in all versions of MySQL we need to support. I'd suggest rewriting this query using a LEFT JOIN to avoid the subquery.