For grouping it is necessary to include the grouped by variables in the projection. If such a variable is not wanted in the outer projection, this can be solved with a sub-
select. The only purpose of the outer
select is to curate the variables that are supposed to be returned.