select
sum(case when a.number>5 then 1 else 0 end) as count_1,
sum(case when a.number>5 then a.number else 0 end) as sum_1 ,
sum(case when a.number<5 then 1 else 0 end) as count_2,
sum(case when a.number<5 then a.number else 0 end) as sum_2
from (select number from table_1 where date>‘2013-01-01 ’and date<=‘2013-01-31’) a
希望能帮助到你!