select * from test;
select * from test2;
[color=red]merge [/color]into test a
using test2 b
on (a.id = b.id)
when matched then
update set a.height = b.height,
a.teleph = b.tel;
-- when not matched then
[color=red]update [/color]test set height = (select t2.height from test2 t2 ,test t1 where t2.id = t1.id and t1.id=3)
[color=red]where [/color]id = 3
update test set height =null
select * from test2;
[color=red]merge [/color]into test a
using test2 b
on (a.id = b.id)
when matched then
update set a.height = b.height,
a.teleph = b.tel;
-- when not matched then
[color=red]update [/color]test set height = (select t2.height from test2 t2 ,test t1 where t2.id = t1.id and t1.id=3)
[color=red]where [/color]id = 3
update test set height =null
5712

被折叠的 条评论
为什么被折叠?



