0
일부 행을 피벗하려는 테이블이 있습니다. 여기에이 질문들이 많이 있지만, 아직도 고민 중입니다.집계가없는 피벗 - 다시
다음은 내가 시작한 표입니다.
select userlicenseid,
startdate,
max(case when name = 'Other' then value end) Other,
max(case when name = 'Pathways' then value end) Pathways,
max(case when name = 'Execution' then value end) Execution,
max(case when name = 'Focus' then value end) Focus,
max(case when name = 'Profit' then value end) Profit
from yourtable
group by userlicenseid, startdate;
SQL Fiddle with Demo를 참조하십시오 : 나는 당신의 샘플 데이터를 기반으로