Skip to content
Advertisement

Joining two tables and adding column values together

I have two tables, in both tables I have a unique column titled phone_number and then a column called spring with 3 others columns. The spring column has a number value. This table has about 3000 rows. I have a duplicate table with the same information but with only about 300 rows. I want to combine the values of both tables’ spring columns based on the phone_number unique column.

I have tried doing a MERGE and also a UNION but I don’t really understand how they work and kept getting syntax errors.

I can get the tables to join but it creates a new column called spring with only the combined column totals and the original table’s other 2700 rows return as NULL. I want to keep the 2700 rows data as well as combine the other 300.

Advertisement

Answer

Is this what you want?

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement