insert into tbl() select * from tb2中加入多個條件
更新時間:2009年06月23日 18:50:15 作者:
insert into tbl() select * from tb2中加入多個條件
復(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
相關(guān)文章
SQL Server創(chuàng)建用戶只能訪問指定數(shù)據(jù)庫和視圖的操作步驟
本文介紹了如何在SQLServer中創(chuàng)建用戶并限定其訪問權(quán)限,包括創(chuàng)建用戶、設(shè)置用戶映射、設(shè)置只能訪問指定的數(shù)據(jù)表或視圖、給指定表或視圖賦予具體權(quán)限和檢查權(quán)限等步驟,這種設(shè)置可以防止用戶訪問到過多不必要的過程表和過程視圖,提高數(shù)據(jù)安全性2024-10-10
一段腳本實現(xiàn)自動備份并保存最近幾天的SQL數(shù)據(jù)庫
這篇文章主要介紹了如何自動備份并保存最近幾天的SQL數(shù)據(jù)庫,需要的朋友可以參考下2014-03-03
MSSQL中刪除用戶時數(shù)據(jù)庫主體在該數(shù)據(jù)庫存中擁有架構(gòu) 無法刪除的解決方法
在ms sql2005 下面刪除一個數(shù)據(jù)庫的用戶的時候提示 數(shù)據(jù)庫主體在該數(shù)據(jù)庫中擁有架構(gòu),無法刪除的錯誤解決方案2013-08-08
圖文教程mssqlserver數(shù)據(jù)庫導(dǎo)出到另外一個數(shù)據(jù)庫的方法
本篇文章通過圖片并茂的方式給大家介紹mssqlserver數(shù)據(jù)庫導(dǎo)出到另外一個數(shù)據(jù)庫的方法,對mssqlserver數(shù)據(jù)庫導(dǎo)出相關(guān)知識感興趣的朋友一起學(xué)習(xí)吧2015-12-12
sql查詢一個數(shù)組中是否包含某個內(nèi)容find_in_set問題
這篇文章主要介紹了sql查詢一個數(shù)組中是否包含某個內(nèi)容find_in_set問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-01-01
SQL?Server中元數(shù)據(jù)函數(shù)的用法
這篇文章介紹了SQL?Server中元數(shù)據(jù)函數(shù)的用法,文中通過示例代碼介紹的非常詳細(xì)。對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2022-05-05

