add support for HAVING clause