不好意小弟已经写来了!
select t.an ,t.rq ,sum(t2.sl) ljzl
from test_lh t left outer join test_lh t2 on t.rq>=t2.rq and t.an=t2.an
group by t.an,t.rq
select t.an ,t.rq ,sum(t2.sl) ljzl
from test_lh t left outer join test_lh t2 on t.rq>=t2.rq and t.an=t2.an
group by t.an,t.rq
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货