Remove unnecessary GROUP BYs