select to_char(T_12895_DET_ENTERED_DATE,'yyyy-mm') as entered_date,
CASE
when T_12916_VIA = 'E' then 'Internet'
when T_12916_VIA = 'R' then 'Store'
when (T_12916_VIA in ('M','F','P') or T_12916_VIA is null) then 'All Others'
end as VIA_CODE,
count(*)
from cmlbrc.applicants
where to_char(T_12895_DET_ENTERED_DATE,'yyyy') >= '2010'
group by to_char(T_12895_DET_ENTERED_DATE,'yyyy-mm'), T_12916_VIA
order by 1,2;
上面的代码给了我多行作为 yyyy-mm 的输出。为什么“所有其他人”不能组合成一排?2010-05 所有其他 278 2010-05 所有其他 975 2010-05 所有其他 223 2010-05 互联网 5124 2010-05 商店 19641
谢谢丹