[sql-server] Each GROUP BY expression must contain at least one column that is not an outer reference