update basplumain set dptid=1
delete from basdept where id!=1
insert into basdept (dptno,dptname)
select dptno,dptname from lhflm
update basdept set pid=b.id from basdept a,(select a.dptno,a.dptname,b.id
from lhflm a
left join basdept b on a.pid=b.dptno) b
where a.dptno=b.dptno and b.id is not null
时间: 2024-12-16 07:15:55