手机
当前位置:查字典教程网 >编程开发 >mssql数据库 >insert into tbl() select * from tb2中加入多个条件
insert into tbl() select * from tb2中加入多个条件
摘要:复制代码代码如下:insertintowarehouse(wlbm,wlmc,ys,wlgg,sybm,wlfl)select*from(s...

复制代码 代码如下:

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中加入多个条件】相关文章:

SQL SERVER 2008 64位系统无法导入ACCESS/EXCEL怎么办

sqlserver查询某个字段在哪些表中存在

SQL Server 2005 更改安装路径目录的方法小结

查找sqlserver数据库中某一字段在 哪

最长用最基本的MSSQL数据库备份与还原

安装SQLServer2005提示SQL Server服务无法启动

SQL2008 附加数据库提示5120错误解决方法

java实现整数转化为中文大写金额的方法

三步堵死 SQL Server注入漏洞

SQL Server 海量数据导入的最快方法

精品推荐
分类导航