SQL select case

Source: Internet
Author: User
Select D. user_id as 'employee ID ', D. user_name as 'name', C. diathesisconfig_year as 'Year', Case. diathesis_name when' Strain Capacity 'then B. diathesis_detailcontent else ''end as 'adaptability ', Case. diathesis_name when 'learning development' then B. diathesis_detailcontent else ''end as 'learning development', Case. diathesis_name when 'Live Mary Kay 'Then B. diathesis_detailcontent else ''end as 'live Mary Kay', Case. diathesis_name when 'decision making 'then B. diathesis_detailcontent else ''end as 'Decision-making ', Case. diathesis_name when 'incentive excitation 'then B. diathesis_detailcontent else ''end as 'incentive activity', Case. diathesis_name when 'Planning implementation 'then B. diathesis_detailcontent else ''end as 'Planning implementation ', Case. diathesis_name when 'then B. diathesis_detailcontent else ''end as 'strategy', Case. diathesis_name when 'Follow the details' then B. diathesis_detailcontent else ''end as 'follow details', Case. diathesis_name when 'establish credentials' then B. diathesis_detailcontent else ''end as 'establish credentials', Case. diathesis_name when 'create vision 'then B. diathesis_detailcontent else ''end as 'create vision ', Case. diathesis_name when 'communication affects then B. diathesis_detailcontent else ''end as 'communication influence', Case. diathesis_name when' leads to 'then B. diathesis_detailcontent else ''end as 'leading direction', Case. diathesis_name when 'team' then B. diathesis_detailcontent else ''end as 'team', Case. diathesis_name when 'Innovative then B. diathesis_detailcontent else ''end as 'innovation', Case. diathesis_name when 'self-motivated 'Then B. diathesis_detailcontent else ''end as 'self-motivated ', Case. diathesis_name when 'use information' then B. diathesis_detailcontent else ''end as 'use information' from mlk_pdp.dbo.test11 A, mlk_pdp.dbo.test22 B, mlk_pdp.dbo.test33 C, mlk_pdp.dbo.sec_user d Where C. user_id = D. user_id and (B. diathesis_detailid = C. diathesis_detailid and. diathesis_sysid = B. diathesis_sysid or. parent_id = B. diathesis_sysid)

 

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.