17,382
社区成员




select t3.id,to_char(t3.time1,'yyyy-MM-dd'),
count(case when t3.button='1' then 1 end) a1,
count(case when t3.button='2' then 2 end) a2,
count(case when t3.button='3' then 3 end) a3,
count(case when t3.button='' then 4 end) a4
from table1 )
) t3 group by to_char(t3.time1,'yyyy-MM-dd'),id
您好,再请问下上面这个
select xb,xl,sum(decode(xb,'男',1,cnt)) as cnt
from(select xb,xl,count(id) as cnt from 表名称 group by xb,xl)
group by xb,xl;