Im having two tables
TableA
Custid prodid Amt1
1 10 200
2 20 300
3 10 400
4 30 300
5 20 400
6 30 200
TableB
prodid Amt2
10 100
20 200
30 300
and i want sum of all amount group by prodid. can any one give me both ansi and Tsql quries.