i hav a 3 tables
1> id amount 2>id amount 3>Id amount
1 100 1 100 1 100
2 200 2 200 2 200
3 300 3 300
4 400
output> id AMOUNT
1 300
2 600
3 600
4 400
let me know the answer any one? Please share with me
ali tuncerPosted Feb 23, 2016, 1:12 AM
you can union tables, group by ID and get sum..
SELECT ID, Sum(Amount)
FROM (select ID,Amount
from Table1
union ALL
select ID,Amount
from Table2
UNION ALL select ID,Amount
from Table3)
GROUP BY ID
Shubham KumarPosted Feb 23, 2016, 1:01 AM