select sum(b) from tab where a='地区2' and c < to_date('2012-12-01','yyyy-mm-dd')
select A as "地区",C as "截止时间", (select sum(B) from test t2 where t2.A=t.A and to_date(t2.C,'yyyy-mm-dd')<=to_date(t.C,'yyyy-mm-dd')) as "总和" from test t order by t.A,t.C
select sum(b) from tab where a='地区2' and trunc(c) < to_date('2012-12-01','yyyy-mm-dd')
select sum(b)
from tab
where a='地区2'
and c < to_date('2012-12-01','yyyy-mm-dd')
(select sum(B) from test t2 where t2.A=t.A and to_date(t2.C,'yyyy-mm-dd')<=to_date(t.C,'yyyy-mm-dd')) as "总和"
from test t order by t.A,t.C
from tab
where a='地区2'
and trunc(c) < to_date('2012-12-01','yyyy-mm-dd')