6
Answers

sql query related !

Subin Thomas

Subin Thomas

5y
637
1
i have a table like below

 name1 name2 amount1 amount2
 aa 111 100 200
 aa 111 200 300
 aa 111 0 100
 aa 111 250 350
 bb 222 150 0
 bb 222 300 400
 cc 333 0 200
 cc 333 350 0
 
here the name aa is repeated also 111 but the amounts are not repeated it is different
  i want the repetative names as one record and the amount should be the sum
 
for eg i want the above table as the below table
 
name1name2amount1amount2
aa111550 950
bb222 450400
cc33350  200
Answers (6)