oracle客户端账号和密码是多少count()函数里面想实现带条件统计,可以使用SUM函数来进行替换

count()函数里面想实现带条件统计,可以使用SUM函数来进行替换

 

count()函数里面想实现带条件统计,可以使用SUM函数来进行替换,具体可以使用case when 语句或者Decode函数来对要统计的数据进行0、1转换, 

 

如下例子: 

SELECT s.user_id,SUM(case(m.is_success) when 1 then 1 else 0 end),SUM(case when m.read_time IS NUoracle账号LL  then 0 else 1 end),COUNT(*) from doc_score s,mail_send_log m where s.user_id in(6,7,8,9) and s.status = 1 and m.doc_id = s.doc_id group by s.user_id ;

 

此条目发表在oracle metalink账号分类目录,贴了标签。将固定链接加入收藏夹。