Insert into tbl () select * from tb2 add multiple conditions

Source: Internet
Author: User
Tags rtrim

Copy codeThe Code is as follows:
Insert into warehouse (wlbm, wlmc, ys, wlgg, sybm, wlfl) select * from (select rtrim (B. bjbm) as bjbm,. bjmc as wlmc,. ys,. clgg as wlgg,. bm,
(Case a. bm when 'injection then 2
When'blow molding 'then 43
When 'looping' then 3
When 'injector 'then 4
When 'carcat' then 45
When 'stamping 'then 19
When 'solder' then 31
When 'vary' then 37
When 'decision bed' then 38

When 'silk file' then 46
When 'sewing then 39
When 'assembly 'then 40
When 'package' 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
On rtrim (B. bjbm) = rtrim (a. bjbm) c

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.