Date operations
От | Barbara Figueirido |
---|---|
Тема | Date operations |
Дата | |
Msg-id | 4D6C5403.6010002@bariloche.com.ar обсуждение исходный текст |
Список | pgsql-novice |
Hello to all! (Please excuse me if this is too noob and if it has already been asked/answered, in that case would you please point me towards the corresponding post or documentation? - TIA) I have a table where I record the history of some file-cabinet-paperwork, classifying it according to the persons affected. There is a table (in fact, it's a view getting its input from a couple of underlying tables) where I record the date of some action, the name of the files and the type of action taken. Now I want to search for those files that haven't been subject to any action for some lapse of time, say backwards 3 months from now, but I cannot figure how to phrase the search, since a "SELECT .... WHERE date < somedate" retrieves all files where some action has been taken before that period but doesn't exclude those that were being acted upon afterwards. What I would like, if possible, is something on the line of "SELECT DISTINCT ON file ..... WHERE date NOT GREATER THAN somedate [ORDER BY date desc]" but cannot seem to find a way to do it. I would greatly appreciate any ideas on this subject, kind regards to all, Barbara F. -- Dra. Bárbara M. Figueirido 25 de Mayo 1331 8400 S.C. de Bariloche - RIO NEGRO Argentina Tel.-Fax: +54 2944 456252 15682745
Вложения
В списке pgsql-novice по дате отправления: