All pastes #230499 Raw Edit

Gopneg

public text v1 · immutable
#230499 ·published 2006-10-31 08:49 UTC
rendered paste body
select sum(coddoc), t.dateexec
from stkdocs t
where t.coddoc < 120000
group by t.dateexec 
order by t.dateexec;
  
                       
select sum(thr.summ), dat 
from 
  ( select distinct (s.dateexec) dat, summ
    from 
    ( select sum(coddoc) summ, one.dateexec dat
      from stkdocs one
      where one.coddoc < 120000
      group by one.dateexec 
      order by one.dateexec) two,
    stkdocs s
    where two.dat <= s.dateexec
          and s.coddoc < 120000) thr
group by thr.dat
order by thr.dat