請教各位大大若想呈現如範例.jpg報名人數數量統計該如何呈現
目前呈現效果如範例2.jpg
select trim(FD.FDEPT_NAME) 上課分店, TO_CHAR(C62.CCES062_STDATE,'YYYY') 年份, c992.cces099_desc 課程大類,c60.CCES060_NAME 主課程名稱,
c62.CCES062_NAME 課程名稱, count( c81.cces081_mbcard) 人數
--count(distinct(c81.cces081_mbcard)) 人數
--count(c60.CCES060_NAME) 主課程名稱
from cces081 c81
join CCES062 C62 ON (C81.CCES081_CLASSID = C62.CCES062_CLASSID)
join CCES099 c992 ON (CCES062_TYPE = c992.cces099_2nd ) and c992.cces099_1st='I' --關聯上課類型
join cces060 c60 on (C62.CCES062_name = C60.CCES060_name)
JOIN FDEPT_view FD ON (trim(fd.fdept_code) = C62.CCES062_AREA)
where TO_CHAR(CCES062_STDATE,'YYYYMMDD')>= '20220101' AND TO_CHAR(CCES062_STDATE,'YYYYMMDD') <= '20221231'
AND FDEPT_ADDRCODE like '%110117%' --and c62.CCES062_NAME like '%簡單洋裁初級班 %'
--AND c62.cces062_type like '%0%' --0初級,1進階,2,證書,3特別講習
--group by c81.cces081_mbcard, c62.cces062_classid, c62.CCES062_NAME, c62.cces062_type, trim(FD.FDEPT_NAME)
group by trim(FD.FDEPT_NAME), TO_CHAR(CCES062_STDATE,'YYYY'),c992.cces099_desc,c60.CCES060_NAME,c62.CCES062_NAME,c81.cces081_mbcard
--group by TO_CHAR(CCES062_STDATE,'YYYY'),c60.CCES060_NAME
--order by TO_CHAR(CCES062_STDATE,'YYYY'),c60.CCES060_NAME
order by c60.CCES060_NAME,c81.cces081_mbcard
--order by FD.FDEPT_NAME desc
--order by cces081_classdate