1. A method for transforming a database statement containing a first subquery and a second subquery joined to the first subquery, the first subquery including a group by operation over a child subquery, the method comprising removing the first subquery from the database statement to remove the join between the first subquery and the second subquery.