Oracle统计多个,满足条件的字段的数
Oracle统计多个,满足条件的字段的数Table:ABCTablea b c1 2 12 1 33 1 2www.zzzyk.com统计a=1的有几个,b=1的有几个,c=1的有几个1. select count(*) from ABCTable where a=1;select count(*) from ABCTable where b=1;select count(*) from ABCTable where c=1;2. SELECT SUM(CASE WHEN a=1 THEN 1 ELSE 0 END) ,SUM(CASE WHEN b=1 THEN 1 ELSE 0 END) ,SUM(CASE WHEN c=1 THEN 1 ELSE 0 END) ,FROM ABCTable t ;