oracle统计
select
sum(case v.changes_id when 2 then '1' else '0' end) X1,
sum(case v.changes_id when 3 then '1' else '0' end) X2,
sum(case v.changes_id when 4 then '1' else '0' end) X3,
sum(case v.changes_id when 5 then '1' else '0' end) X4,
sum(case v.changes_id when 6 then '1' else '0' end) X5,
sum(case v.changes_id when 7 then '1' else '0' end) X6,
sum('1') nums
from table v where v.x=1 and v.date >=20190101 and v.s=1;