| От | Adam Rich |
|---|---|
| Тема | Re: Interval ordering |
| Дата | |
| Msg-id | 006901ccded6$d379e350$7a6da9f0$@sbcglobal.net обсуждение |
| Ответ на | Re: Interval ordering (Adrian Klaver <adrian.klaver@gmail.com>) |
| Ответы |
Re: Interval ordering
|
| Список | pgsql-general |
> How about something like: > test(5432)aklaver=>SELECT ts_fld2,now()-ts_fld2 from timestamp_test order by > now()-ts_fld2 limit 5; Thanks Adrian, Let me explain the problem better. Say my table has 24 entries, one for each hour, midnight through 11 pm. If the user enters "6:30 PM", I want to give them the closest times in proximity - both before AND after - to their input... so in this case, I'd return 5:00 PM, 6:00 PM, 7:00 PM, 8:00 PM, etc. I believe your solution only provides the closest times BEFORE and not AFTER.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера