implement having clause analysis
Merge pull request #1105 from crate/m/having-analysis

M/having analysis