首页 > 代码库 > 【数据处理】切换新分类码

【数据处理】切换新分类码

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

 

【数据处理】切换新分类码