Sir,
i have two table
the table1 is payment table with following data
id Total paid balance
1 4500 4500 0
the 2nd table is payment history with following data
id Total paid balance
1 4500 0 4500
1 4500 4500 0
i want sum of total,sum of balance from table 1
and sum of paid from table2. like below
total paid balance
4500 4500 0
I am usin g following query for get this result
select SUM(a.total),SUM(b.paid),SUM(a.balance) from payment a join paymenthistory b on a.req_no=b.req_no
but it gives following result
total paid balance
9000 4500 0
how to get sum from two different tables.?