i have two tables i my database in which i have two columns in each table one is for userid & one is for showing some numeric data.
I just want to add the value of the numeric column but the issue is that it's not compulsory that both the table have same used id.
I will try to explain it using example:
table1
userid score1
1 200
2 300
table2
userid score2
1 400
so now what i want to do is to sum the score form these two tables as per the user id and show it in a new table like this:
userid score_sum
1 600
2 300
if i simply use
Select sum(table1.score1+table2.score2)
FROM table1 JOIN table2 ON table1.id=table2.id
then it will only show the sum for userid 1
because userid 2
is not present in the second table.So please suggest me how to solve this issue.