# 内连接
UPDATE standard_gw_all s
INNER JOIN detail_data t ON s.std_no=t.std_no and s.pub_year=t.pub_year
SET s.detail_id=t.guid_num
# 方法2
UPDATE standard_gw_all s, detail_data t
SET s.detail_id=t.guid_num
WHERE s.std_no=t.std_no and s.pub_year=t.pub_year
行转列 →