SQL 同一个表中 根据一列更新另一列(不同行)
已知红,根据红update出绿.
update tab_wbap_wbs t set t.prepose_wbs_id = (select wbs_id from tab_wbap_wbs m where t.prepose_wbs_no = m.wbs_no and m.project_id = 281) where t.project_id = 281 and t.prepose_wbs_no <> '0' and (t.prepose_wbs_id = '0' or t.prepose_wbs_id is null)