根据表employee的字段emp_no ,emp_name,对表forecasted_statement的emp_no 字段进行更新,emp_name 作为连接条件。 update sales_test.forecasted_statement set forecasted_statement.emp_no = (select employee.emp_no from sales_test.employee join forecasted_statement on employee.emp_name = forecasted_statement.SECTOR_OWNER ) where exists (select 1 from sales_test.employee join forecasted_statement on employee.emp_name = forecasted_statement.SECTOR_OWNER); employee表: forecasted_statement表: |