insert into enterpriseinfo (id,code,enterpriseName,prefecture,plevel,etype) select dw.id,dw.code,dw.name enterpriseName,d.code prefecture,dw.levl plevel,2 etypefrom jyjc.danwei dw left join jyjc.diqu d on d.id = dw.diqu where dw.levl <> 0;