关联更新 UPDATE
UPDATE t_alert_equipment_collect tab2
SET tab2.collect_id = (
SELECT
tab1.id
FROM
t_equipment_collect tab1
WHERE
tab1.collect_code = tab2.device_source
);
关联更新 UPDATE
UPDATE t_alert_equipment_collect tab2
SET tab2.collect_id = (
SELECT
tab1.id
FROM
t_equipment_collect tab1
WHERE
tab1.collect_code = tab2.device_source
);