我会用两个
sums来做不同的事情:
select sum ( case when endOfUse is null and addDate >= '1/1/2014' then 1 else 0 end ) * 100.0 -- if you want the usual 0..100 range for percentages / sum ( case when addDate >= '1/1/2014' then 1 else 0 end ) percentagefrom saxref..AuthCycle



