场景:update 多表关联
表1与表2根据seriaild 列做关联
修改 set 表1.receive_ymd=表2.ymd
UPDAT SQL语句:
UPDATE
table_1
SET receive_ymd=inputymd
FROM(
SELECT
*
FROM table_1 AS ta_1
INNER JOIN tbale_2 AS tb_2
ON ta_1.serialid=tb_2.serialid
)tbs
WHERE table_1.create_time=tbs.create_time AND table_1.serialid=tbs.serialids
修改后的数据如下: