support having clause in group by

Literal check is missing, see globalAggregation