I have this sample problem where I want to update table test1 if the id in both tables match.
Problem (sample data):
========
Table "Test1"
id name
-- -------
1 "rrr"
2 "ttt"
4 "sss"
Table "Test 2"
id name
-- -------
1 "fff"
2 "ggg"
3 "hhh"
Expected Results:
Results:
Test1:
id name
-- ------
1 "fff"
2 "ggg"
4 "sss"
This query doesnt work. What is wrong with it ?
update Test1
set Test1.name = Test2.name
from Test1, Test2
where Test1.id = Test2.id
Much thanks,
Nga
Problem (sample data):
========
Table "Test1"
id name
-- -------
1 "rrr"
2 "ttt"
4 "sss"
Table "Test 2"
id name
-- -------
1 "fff"
2 "ggg"
3 "hhh"
Expected Results:
Results:
Test1:
id name
-- ------
1 "fff"
2 "ggg"
4 "sss"
This query doesnt work. What is wrong with it ?
update Test1
set Test1.name = Test2.name
from Test1, Test2
where Test1.id = Test2.id
Much thanks,
Nga