我想统计表中根据user分组的count,和某一字段a为空的count,我这样写,但提示出错,未找到预期的from,请问怎么回事啊?select
count1 = sum(case where 1=1 then 1 else 0 end),
count2 = sum(case where a is null then 1 else 0 end),
user
from
tab
where
group by user
order by user desc
count1 = sum(case where 1=1 then 1 else 0 end),
count2 = sum(case where a is null then 1 else 0 end),
user
from
tab
where
group by user
order by user desc
是case when 吧,再看看你的oracle 版本是不是9i以上的,8i及以下的版本是不支持case when 的