Re: SQL problem enclosed. SELECTing moving window of values...

From: Lennart Jonsson <lennart_at_kommunicera.umea.se>
Date: Thu, 08 Nov 2001 10:20:44 GMT
Message-ID: <00tG7.17299$xS6.27216_at_www.newsranger.com>


In article <p1ajut8orckoa3h8aga7jpnc03q1t4ub07_at_4ax.com>, Remo Williams says...
>

[...]

Is the following somewhere near what you wish for?

select x.m1, x.m2, count(1) as cum_sum from (select distinc t monthname(a.changedate) as m1, month(a.changedate) as m2, b.* from wostatus a , wostatus b where a.status = b.status and a.status = 'INPRG' and a.changedate
>= b.changedate and a.changedate <= '3/1/2000' and b.changedate <= '3/1/2000')

as x group by x.m1, x.m2 order by x.m2

M1 M2 CUM_SUM
-------- ------------ ----------- -----------

januari  1            2
februari 2            3
mars     3            4

3 record(s) selected.

/Lennart Received on Thu Nov 08 2001 - 11:20:44 CET

Original text of this message