復(fù)制代碼 代碼如下:
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
您可能感興趣的文章:- 數(shù)據(jù)庫插入數(shù)據(jù)之select into from與insert into select區(qū)別詳解
- insert into select和select into的使用和區(qū)別介紹
- 解析MySQL中INSERT INTO SELECT的使用
- SELECT INTO 和 INSERT INTO SELECT 兩種表復(fù)制語句簡單介紹
- INSERT INTO SELECT語句與SELECT INTO FROM語句的一些區(qū)別
- insert select與select into 的用法使用說明
- mssql insert into 和insert into select性能比較
- select into 和 insert into select 兩種表復(fù)制語句
- SELECT INTO 和 INSERT INTO SELECT 兩種表復(fù)制語句詳解(SQL數(shù)據(jù)庫和Oracle數(shù)據(jù)庫的區(qū)別)