How to take sum from two tables

Sep 1 2011 7:56 AM
Hai all

I have two tables. table1 and table2 as follows

Table1
iddateamnt
101/01/2011100
105/01/2011100
110/01/201150
116/01/2011500
117/01/2011550
201/01/201110
215/01/2011100
218/01/2011800
220/01/2011450
310/01/201115


Table2
idnanhnm
1MadhuNamparayil
2AnoopPuthenveettil
3DhanyaPayyampallil

I want id, nam,hnm, sum(amnt) of the above three customers as follows
1-Madhu   - Namparayil     - 1300
2-Anoop   - Puthenveettil  - 1360 
3-Dhanya - Payyampallil    -  15
 Please give SQL command using c#

Answers (3)