In SQL 2005 you could have a group by statement in a subquery without a problem, in 2008 SP1 this does not work. This is not documented on the breaking changes page for SQL Server 2008:
It does not work even when running databases set to SQL 2005 compatibility level.
While this is not very useful and it is easy to work around, it can show up when migrating from SQL 2005 to SQL 2008. This should work when running databases in SQL 2005 compatibility and it should be documented on the breaking changes page