• Krishna1 (6/27/2013)


    But if you see my query it has got differnt where clasues for the 2 query hence can not use roll up.

    I overlooked that the WHERE clause is different. In that case I don't think there is another way to write the query. But I agree with Sean Lange to replace your UNION with the UNION ALL statement if your resultset doesn't have to be GROUPED BY.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **