insert into T_Jxc_PtypeUnit(Ptypeid,nunit,unitname,BarCode) select 临时表.typeid,临时表.nunit,临时表.unitname,临时表.BarCode
from
(select typeid,1 as nunit,'个' as unitname,BarCode from ptype where Name like '%正牛%'
union
select typeid,2 as nunit,'箱' as unitname,'' BarCode from ptype where Name like '%正牛%'
union
select typeid,3 as nunit,'' as unitname,'' BarCode from ptype where Name like '%正牛%') as 临时表