Thanks for your quick reply.
Problem resolved. First query is Grouped By "AppName"
and second query is Grouped By "Server".
When I made first query to be grouped by "Server, AppName' result is coming properly.
but, I am still not clear why should it make difference based on the group by columns. I dont understand.
Thanks.