spec for merged group by clauses