Multi-level GROUP BY clause is not allowed in a subquery. (Error 3612)

An SQL subquery cannot list more than one field in a GROUP BY clause.