jdxyzlh 发表于 2018-9-22 11:00:09

oracle中decode和case的使用例子

select sum(case when count_01 10 and count_01 20 and count_01 50 and count_01 100 and count_01 200 and count_01 500 and count_01 1000 then 1 else 0 end) as g1000
  from (select ssn,sum(t.changepoints + t.fpoints) count_01
  from pay_detail_new_200701 t
  where serviceip not in ('charge','ptransfer')
  group by t.ssn);

页: [1]
查看完整版本: oracle中decode和case的使用例子