| От | Paul Jungwirth |
|---|---|
| Тема | Re: Group by range in hour of day |
| Дата | |
| Msg-id | 55087619.7000408@illuminatedcomputing.com обсуждение исходный текст |
| Ответ на | Re: Group by range in hour of day (Israel Brewster <israel@ravnalaska.net>) |
| Список | pgsql-general |
>> Some weird edge cases to be careful about: activities that cross midnight. >> Activities that last more than one full day, >> e.g. start 3/15 and end 3/17. > Right. And I will run into some of those (at least the crossing midnight), > so I'll keep an eye out. If you are running the report on more than one day at a time, I think David Johnston is right that you want to convert from integers [0, 23] to timestamps as soon as possible, possibly even just generate a series of timestamps rather than integers right from the beginning. Also beware of extract(hour from foo). Probably you want tsrange intersection as your join condition rather than BETWEEN. Paul
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера