insert into tbl() select * from tb2中加入多个条件

发布时间:2022-04-18 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了insert into tbl() select * from tb2中加入多个条件脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
复制代码 代码如下:

insert into warehouse(wlbm,wlmc,ys,wlgg,sybm,wlfl) select * From (select rtrim(b.bjbm) as bjbm,a.bjmc as wlmc, a.ys, a.clgg as wlgg,a.bm,
(case a.bm when '注塑' then 2
when '吹塑' then 43
when '搪胶' then 3
when '喷油' then 4
when '车梳' then 45
when '冲压' then 19
when '焊' then 31
when '烤漆' then 37
when '裁床' then 38

when '丝印' then 46
when '车缝' then 39
when '装配' then 40
when '包装' then 42

end) as wlfl
From (select distinct(rtrim(bjbm)) as bjbm from dbo.CP_LB where bjbm<>'' and bjbm not in (select wlbm from warehouse)) b left JOIN dbo.CP_LB a
on rtrim(b.bjbm)=rtrim(a.bjbm)) c

脚本宝典总结

以上是脚本宝典为你收集整理的insert into tbl() select * from tb2中加入多个条件全部内容,希望文章能够帮你解决insert into tbl() select * from tb2中加入多个条件所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:insert