var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Windowing Function Range Between Dates
How do I write an SQL that will give results based on a moving window based on a date range?
For e.g. in the following table
for a given I want to produce the sum of AmtCol between the last month and the next following month.
KeyCol AmtCol DateCol
1 10 2013-01-01
2 20 2013-02-01
3 30 2013-03-01
4 40 2013-04-01
Based on what you've written, what would be INPUT (which months, or dates, or what?) and what would be OUTPUT?
I don't understand that. If there's "last month", then it is LAST and there's no "next following month" after that.
between the last month and the next following month
I was a little disappointed for her(him?) to post in DB2 forum too.
If (s?)he want to learn SQL more generally, (s)he may want to ask in
ANSI SQL - dBforums
Last edited by tonkuma; 06-06-13 at 12:20.