Added HAVING support