support having clause in group by