| От | Martijn van Oosterhout |
|---|---|
| Тема | Re: Temporal query question |
| Дата | |
| Msg-id | 20041130111230.GA30959@svana.org обсуждение исходный текст |
| Ответ на | Temporal query question ("Stefano Bonnin" <stefano.bonnin@comai.to>) |
| Список | pgsql-general |
The usual syntax is something like: select myfield,numeric_field from mytable where temporal_attribute_a < temporal_attribute_b - ( numeric_field * '1 day'::interval); One of the temporal_attributes tends to be 'now' or 'today' but the principle is the same... On Tue, Nov 30, 2004 at 11:30:16AM +0100, Stefano Bonnin wrote: > Hi all, > > I have a "simple" question about the following temporal query with "interval" operator: > > can I define a query of this type? > > select myfield,numeric_field from mytable where temporal_attribute < temporal_attribute - interval numeric_field || ' days' > > obviously this syntax is wrong. > In other words, is there a way to define a query with a interval operator with variable argument? > Thanks > Stefano -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера