匿名通过本文主要向大家介绍了insert,多条件等相关知识,希望本文的分享对您有所帮助
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
您可能想查找下面的文章:
- msyql show命令汇总
- mysql如何让自增id归0解决方案
- 如何测试mysql触发器和存储过程
- mysql 触发器实现两个表的数据同步
- SELECT INTO 和 INSERT INTO SELECT 两种表复制语句简单介绍
- 使用MySQL的LAST_INSERT_ID来确定各分表的唯一ID值
- MySQL中REPLACE INTO和INSERT INTO的区别分析
- mysql insert if not exists防止插入重复记录的方法
- mysql insert的几点操作(DELAYED,IGNORE,ON DUPLICATE KEY UPDATE )
- mysql 操作总结 INSERT和REPLACE