I have two tables at the moment.
Table1
+-----+----+
id val
1 a
2 b
3 c
4 d
5 e
+-----+----+
Table2
+----+-----+
id val
1 aa
2 bb
3 cc
+----+-----+
I want a resultant table to look like this replacing values in table1 from table2 like so and keeping the renaming intact
Resultant table
+-----+-----+
id val
1 aa
2 bb
3 cc
4 d
5 e
+-----+-----+
I've tried the following code
UPDATE Table1
SET Table1.val = Table2.val
where Table1.id = Table2.id
but i get an error that
table2.id cannot be bound
Is there any other solution ? Bear in mind that both tables do not have same length