Gopneg
public text v1 · immutableselect 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