Re: [SQL] time comparing
От | Remigiusz Sokolowski |
---|---|
Тема | Re: [SQL] time comparing |
Дата | |
Msg-id | Pine.GS4.4.02A.9903091404550.5490-100000@netra.gdansk.sprint.pl обсуждение исходный текст |
Ответ на | Re: [SQL] time comparing (Patrik Kudo <kudo@partitur.se>) |
Список | pgsql-sql |
> > hi! > > I need to compare two values of time. > > One of them is just value of field - I want to compare it to value of > > now() less 1 hour - shortly I want to select all records which are older > > then 1 hour - how to do that? > > Ah! This reminds me! I've been wondering about a similar problem. How do > I > exchange that 1 hour with one week or one month? Probably the same way > as > with one hour (if there is any easy way)... hi! I just solve this there is function age() I do that this way age(datetime(my_timestamp_fld),datetime(now())) > 3600::timespan But I'm still wonder if all function are write for datetime type. I thought that timestamp is hmmm... some kind of basic internal representation of time, so search for such function for type timestamp - I have 6.3.2 ver. May be in newer version there are already functions for timestamp type? Rem -------------------------------------------------------------------*------------ Remigiusz Sokolowski e-mail: rems@gdansk.sprint.pl * * -----------------------------------------------------------------*****----------
В списке pgsql-sql по дате отправления: