support having clause in group by

literal check missing here also