| От | A. Kretschmer |
|---|---|
| Тема | Re: Need magic for a moving statistic |
| Дата | |
| Msg-id | 20091002131036.GA25746@a-kretschmer.de обсуждение исходный текст |
| Ответ на | Re: Need magic for a moving statistic (Andreas <maps.on@gmx.net>) |
| Список | pgsql-sql |
In response to Andreas : > > A. Kretschmer schrieb: > >[...] Or simpler: > > > >test=*# select ((d-'2009-10-02'::date)/14) || '. period' as period, > >sum(value) from foo group by 1; > > > This is tricky, because you use a text-column to sort but need numerical > sorting since there will be more than 0-9 periods. Yes, sure. Use ((d-'2009-10-02'::date)/14) instead for order. My fault. > > This is still the way to handle the periodity without pulling out some > external skript language. > Thanks for the reply. :) Glad to help you ;-) -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера