Tip:
不能直接关联修改,需要一个临时表。
with tem as (
select npi_product_name ,npi_product_id from ludp_tooling_dashboard ltd
where npi_product_id is not null
group by npi_product_name ,npi_product_id
)
update device_manage as dm set project_name =tem.npi_product_name
from tem
where dm.npi_product_id =tem.npi_product_id;