If your DBMS supports the UNPIVOT function, you could try this.
SELECT Proposal_source, [%]
from (select candidate_generator,
crm_srt_ui,
knock_on_effect,
matchmaker_mutator,
ml_models,
object_association,
script_manual_data,
unified_onboarding
from tableA) p
UNPIVOT
( [%] FOR Proposal_source in
(candidate_generator,
crm_srt_ui,
knock_on_effect,
matchmaker_mutator,
ml_models,
object_association,
script_manual_data,
unified_onboarding )
) as unpvt;
If it does not support UNPIVOT, Then you could try union all the columns together
SELECT 'unified_onboarding' as Proposal_source, unified_onboarding as '%' FROM tableA
UNION
SELECT 'script_manual_data' as Proposal_source, script_manual_data as '%' FROM tableA
UNION
SELECT 'matchmaker_mutator' as Proposal_source, matchmaker_mutator as '%' FROM tableA
UNION
SELECT 'ml_models' as Proposal_source, ml_models as '%' FROM tableA
UNION
SELECT 'candidate_generator' as Proposal_source, candidate_generator as '%' FROM tableA
UNION
SELECT 'knock_on_effect' as Proposal_source, knock_on_effect as '%' FROM tableA
UNION
SELECT 'crm_srt_ui' as Proposal_source, crm_srt_ui as '%' FROM tableA
UNION
SELECT 'object_association' as Proposal_source, object_association as '%' FROM tableA
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.