关于存储过程的提问
一张表叫A,有字段N1,N2,另一张表B和它结构完全相同,现在A表有数据多条;我想用存储过程把A表数据完全同步过去,但是同步的前提条件是A表的字段N1不能为空,请教
------解决方案--------------------用merge into来做,简单高效
------解决方案--------------------MERGE INTO TABLE_B A
USING TABLE_A B
ON (A.N1 = B.N1 AND A.N2 = B.N2)
WHEN MATCHED THEN
UPDATE SET A.N1 = B.N1, A.N2 = B.N2
WHEN NOT MATCHED THEN
INSERT (N1, N2) VALUES (B.N1, B.N2)