I have two tables tb1 and tb2. I would like to sum up field values from two tables. How to do this using a SQL statement.
tb1
Name Salary
Bob 1000
Tom 2000
John 3000
Winson 4000
tb2
Name Bonus
Bob 100
Tom 200
I would like to get the following result
Name Total
Bob 1100
Tom 2200
John 3000
Winson 4000
I have tried with the following statement but no luck.
SELEC tb1.Name, SUM(tb1.Salary + tb2.Bonus) Total From tb1, tb2 WHERE tb1.Name = tb2.Name group by tb1.Name order by Total