I wtote the following query by using union all. we name it query 1
select 'Dispatch Local' as 'Head',Sum(TotalPrice) 'Amount' from tblDispatchLocal
union all
select 'Sales Trans:' as 'Head',Sum(P_Price) 'Amount' from tblSalesTran
union all
select 'Loan Recovery:' as 'Head',Sum(R_Amount) 'Amount' from tblLoanRefund
its Total is 242700
in the same I wtote the following query by using union all. we name it query 2
select 'Feeding Consumption' as 'Head' , Sum(Price) as Amount from tblConsumption --group by D_Date
union all
select 'Misc Consumption' as 'Head' , Sum(Rate * Qty) as Amount from tblConsumptionMedicine
union all
select 'Semen' as 'Head' , Sum(Cost) as Amount from tblBreading
union all
select 'Treatment' as 'Head' , Sum(Price * Quantity) as Amount from tblTreatment
union all
select 'Purchase Transactions' as 'Head' , Sum(P_Price) as Amount from tblPurchaseTran where P_Head='Expenditure'
union all
select 'Employee Salary' as 'Head' , Sum(Paid_Amount) as Amount from tblSalaryGenerate
union all
select 'Employee Loan' as 'Head' , Sum(L_Amount) as Amount from tblLoan
union all
select 'Rent / Gas / Phone / Electricity',sum(P_Amount) as Amount from tblExpenditure where Code in ('1','2','3','4')
union all
select E_Category,sum(P_Amount) as Amount from tblExpenditure where Code not in ('1','2','3','4') group by E_Category
its Total is 20670
Now I want
Query1 - Query 2
242700 - 20670 = 222030
how to get solution plz