Why would GROUP BY part of the SELECT statement cause any special isues with dynamic SQL? Use GROUP BY in EXECUTE IMMEDIATE exactyl as you use it in regular SELECT statement.

Why would GROUP BY deserve any different treatement in EXECUTE IMMEDIATE as other regular clauses of the SELECT statement do (like WHERE or ORDER BY clauses)?