आप सशर्त एकत्रीकरण का उपयोग कर सकते हैं यदि यह ज्ञात हो कि irt_tlevel कॉलम में अलग-अलग मानों की संख्या निश्चित है।
select
extract(year from a.created) as Year,
a.testscoreid,
sum(case when b.irt_tlevel = 'Low' then 1 else 0 end) as Low,
sum(case when b.irt_tlevel = 'Medium' then 1 else 0 end) as Medium,
sum(case when b.irt_tlevel = 'High' then 1 else 0 end) as High,
count(*) as Questions
from asmt.testscores a
join asmt.questions b on a.questionid = b.questionid
where a.answered = True
group by Year, a.testscoreid
order by Year desc, a.testscoreid