Could not get the having clause ...
can anyonce please explain?
Sure - but such a broad question is too hard to answer (other than with a reference to Books Online).
Have you read the explanation that is given after replying to the question? And have you read the discussion here?
If, after reading all that, you still have a question, I'll be happy to answer - as soon as you tell me what exactly you don't understand.
Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis