I want to update Table2 names with names from Table1 with matching Ids
I have around 100 rows in each table.
Here is my sample tables.
Table1
- ID
- Name
Table2
- ID
- Name
Sample data
Table1
ID |Name
--------
1 |abc
2 |bcd
Table2
ID |Name
--------
1 |xyz
2 |OOS
Expected result
Table2
ID |Name
--------
1 |abc
2 |bcd
How can I do this?
You can use an
UPDATEwith aJOINof the two tables on theidfield:See SQL Fiddle with Demo