MERGE函数使用

MERGE INTO vin1 t1
USING (SELECT vin2.vin,vin2.sj,
ROW_NUMBER() OVER(PARTITION BY vin2.vin ORDER BY vin2.vin DESC) RN
FROM vin2 ,vin1
WHERE vin1.vin=vin2.vin
) T2
ON (T1.vin = T2.vin AND T2.RN = 1)
WHEN MATCHED THEN
UPDATE
SET T1.sj = t2.sj

上一篇:Linux之文本处理的练习


下一篇:c++ 覆盖、重载、隐藏