Need magic for a moving statistic

Поиск
Список
Период
Сортировка
От Andreas
Тема Need magic for a moving statistic
Дата
Msg-id 4AC55231.2080008@gmx.net
обсуждение исходный текст
Ответы Re: Need magic for a moving statistic  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Список pgsql-sql
Hi,

I need some magic for a moving statistic that works on a rather big 
table starting at a given date within the table up until now.
The statistic will count events allways on fridays over periods of 2 
weeks before ... biweekly?
So I'd like to get a line every 2 weeks for everthing between.

I sadly don't know how to spell that does:

collect data   where  insert_date  between  friday1   and   friday1 + 
inteval '2 week'
collect data   where  insert_date  between  friday1 + inteval '2 week'  
+ inteval '1 second'   and   friday1 + inteval '4 week'
collect data   where  insert_date  between  friday1 + inteval '4 week'  
+ inteval '1 second'   and   friday1 + inteval '6 week'

Is this possible ?


regards



В списке pgsql-sql по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Can i customize null-padding for outer joins?
Следующее
От: Andreas
Дата:
Сообщение: Re: SQL moving window averages/statistics