Skip to content
Advertisement

How to in insert new rows from one table to another based on date?

I am having two tables (table1 and table2). I have columns Date, A, B, C in table1 and columns Date, D, E in table2. I need to transfer column D and E from table2 to table1 based on Date in both the tables.

I tried below code but getting ‘multi-part identifier “table1.Date” could not be bound.’ error

Expected output:

Advertisement

Answer

First you have to add those columns to Table1. Then you need to update the existing rows. Something like this should work.

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