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)