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
相关文章
使用sp_xml_preparedocument处理XML文档的方法
有时会在存储过程中处理一些XML格式的数据,所以会用到sp_xml_preparedocument,他可以将XML数据进行读取,然后使用 MSXML 分析器 (Msxmlsql.dll) 对其进行分析。2011-08-08mssql server 存储过程里,bulk insert table from ''路径+文件'',路径固定,文件名
mssql server 存储过程里,bulk insert table from ''路径+文件'',路径固定,文件名不固定的实现方法...2007-07-07CentOS安装SQL Server vNext CTP1教程
这篇文章主要为大家详细介绍了CentOS上安装SQL Server vNext CTP1的相关过程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2016-11-11sqlServer使用ROW_NUMBER时不排序的解决方法
ROW_NUMBER必须指写over (order by **),有时我根本就不想排序,想按原始顺序,那么就可以参考下面的方法2013-06-06
最新评论