VINAY KUMAR

VINAY KUMAR

  • 1.3k
  • 90
  • 62k

compare two tables select distinct field

Mar 15 2017 7:46 AM
i have table like below
table_a 
sno    name    student_id      
1        abcd         1
2       bcad         2
 
 
table_b
 
sno    student_id      amount  
1              1                   600
2               1                  500
3                  2                200
 compare twotables addition amount field and select name field
i want like below format
  Student_id      name    totalamount
        1                abcd       1100
        2                bcad         700
 
 

Answers (4)