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

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

 

select a.pluno,a.pluname,b.dptno,c.id into lsspm
from 商品码A a
left join xbspm b on a.pluno=b.pluno
left join basdept c on b.dptno=c.dptno

posted @ 2014-08-30 16:25  nlg3413  阅读(167)  评论(0)    收藏  举报