广

MSSQL

  • MYSQL
  • MSSQL
  • Redis
  • MongoDB
  • oracle数据库
  • 数据管理

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

    2018-05-07 10:25:06 次阅读 稿源:互联网
    零七网广告
    全网推广平台,软文发布
    代码如下:

    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

    零七网部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与零七网进行文章共享合作。

    零七网广告
    零七网广告
    零七网广告
    零七网广告