我的视图将每个计数的结果输出为一列。我需要重组下面的代码,以便将每个计数输出为一行:一列标识计数,一列标识计数结果。任何帮助将不胜感激。
CREATE OR REPLACE VIEW oa_count_ii
AS
SELECT COUNT(
CASE
WHEN cap_udfi IN ('NEW_ENT','IRP_RVW')
AND mhd_mscc = 'ADMUHFLSCP'
THEN 1
END ) newapp_admuhflscp,
COUNT(
CASE
WHEN cap_udfi IN ('APF_RVW','RVW_RVW','TUT_RVW','TU2_RVW','TUT_DC1','TU2_DC1','RVW_IRP','IRP_IIO','IRP_DC1','IIO_DC1','RECALL')
AND cap_dec1 = 'No Decision'
AND mhd_mscc = 'ADMUHFLSCP'
AND mhd_tsks = 'P'
THEN 1
END ) apfrvw_admuhflscp,
COUNT(
CASE
WHEN cap_udfi IN ('RVW_TUT','TUT_TU2')
AND mhd_mscc IN ('FACPSYCHL1','FACPSYCHL2')
AND mhd_tsks ='T'
THEN 1
END ) rvwtutw_admuhflscp,
FROM oa_intray;