hi

you are using wrong order in query.
first write group by
second having clause

after that run the query you will get right answer.

nandini