MySQL、Oracle将一张表的字段更新进另一张表
- MySQL
-- 对于A、B两表,如果JGBM字段的值相同,就将B表的“信用代码”字段的值,赋给B表的“NEWJGBM”字段。
update
ZD_JGZC_MAP_BIRTH as A,
xydm as B
SET
A.NEWJGBM = B.信用代码
WHERE
A.JGBM = B.JGBM;
- Oracle
MERGE INTO
ZD_JGZC_MAP_BIRTH a
USING
ZD_JGZC_MAP_BIRTH_delta_230711 b
ON
(a.JGBM = b.JGBM)
WHEN matched THEN
UPDATE SET a.NEWJGBM = b.NEWJGBM;
学习使我充实,分享给我快乐!