While difficult to tell without sample data, the OP may have a 1 to many, or many to many, relationship between the tables. This would result in one or both of the aggregates being wrong. (ie Not a cartesian product but more rows than he was expecting.)SELECT SUM(D2.ActualInvoiceAmount) AS ActualInvoiceAmount ,SUM(D1.PlanInvoiceAmount) AS PlanInvoiceAmountFROM( SELECT p.Invoice_NO ,P.Rev_HD_code ,SUM(p.AMT_INVOICE) AS PlanInvoiceAmount FROM PJ_TRN_INV_PLAN p WHERE p.REV_HD_CODE = 'QMS SOUTH' AND p.MONTH_CODE = 3 AND p.YEAR_NO = 2009 GROUP BY p.Invoice_NO ,P.Rev_HD_code) D1 JOIN ( SELECT i.Inv_No ,i.Revenue_code ,SUM(i.Amount) AS ActualInvoiceAmount FROM mst_Invoice i GROUP BY i.Inv_No ,i.Revenue_code ) D2 ON D1.Invoice_NO = D2.i.Inv_No AND D1.Rev_HD_code = D2.Revenue_code