Re: [SQL] time comparing - Mailing list pgsql-sql

From Remigiusz Sokolowski
Subject Re: [SQL] time comparing
Date
Msg-id Pine.GS4.4.02A.9903091404550.5490-100000@netra.gdansk.sprint.pl
Whole thread Raw
In response to Re: [SQL] time comparing  (Patrik Kudo <kudo@partitur.se>)
List 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 by date:

Previous
From: Patrik Kudo
Date:
Subject: Re: [SQL] time comparing
Next
From: secret
Date:
Subject: How to optimize a query...