All pastes #123322 Raw Edit

Gopneg

public text v1 · immutable
·published 2006-08-09 05:49 UTC
rendered paste body
select sum(rat), dat 
from 
  ( select distinct (s.dateexec) dat, 1 rat, 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