Virviil
Virviil

Reputation: 632

SQL record matching

I get 2 records from queries. First record is:

1|1
2|2
3|3

Second is

1|4
2|5
3|6

How to return table a+b?

1|5
2|7
3|9

Upvotes: 0

Views: 30

Answers (1)

user330315
user330315

Reputation:

This is a very basic join between the two tables:

select t1.id, t1.col1 + t2.col2
from t1 
  join t2 on t1.id = t2.id

Upvotes: 1

Related Questions