Adding having functionality and tests

I needed to have a query with having, so I implemented it =)
It is needed when you have to filter aggregations like group by or sub queries with an alias