insert into tbl() select * from tb2中加入多個條件
更新時間:2009年06月23日 18:50:15 作者:
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
相關文章
sql分組后二次匯總(處理表重復記錄查詢和刪除)的實現(xiàn)方法
這篇文章主要介紹了sql分組后二次匯總的實現(xiàn)方法,需要的朋友可以參考下2017-02-02sql server創(chuàng)建臨時表的兩種寫法和刪除臨時表
這篇文章主要介紹了sql server創(chuàng)建臨時表的兩種寫法和刪除臨時表 ,需要的朋友可以參考下2015-07-07SQL語句執(zhí)行超時引發(fā)網站首頁訪問故障問題
由于獲取網站首頁列表的 SQL 語句出現(xiàn)突發(fā)的查詢超時問題,造成訪問網站首頁時出現(xiàn) 500 錯誤,在故障期間記錄了大量錯誤,小編給大家分享到腳本之家平臺,感興趣的朋友一起看看吧2020-02-02sqlserver 中ntext字段的批量替換(updatetext的用法)
在Sql Server 中,ntext/text/image 字段不允許應用replace函數替換內容2009-09-09MSSQL優(yōu)化之探索MSSQL執(zhí)行計劃(轉)
最近總想整理下對MSSQL的一些理解與感悟,卻一直沒有心思和時間寫,晚上無事便寫了一篇探索MSSQL執(zhí)行計劃,本文講執(zhí)行計劃但不僅限于講執(zhí)行計劃2011-10-10