Re: [SQL] timestamp/now in views - Mailing list pgsql-sql

From wieck@debis.com (Jan Wieck)
Subject Re: [SQL] timestamp/now in views
Date
Msg-id m11w5Kz-0003kGC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to timestamp/now in views  ("Graeme Merrall" <gmerrall@email.com>)
List pgsql-sql
>
> Sorry for being an idiot but I saw something similar to this in the docs but
> haven't been able to find it since.
> I tried creating a view using the following syntax
> CREATE VIEW prev_day AS SELECT * FROM audit WHERE audit_datetime >
> (current_timestamp - interval'24 hours');

    ... WHERE audit_datetime >
                timestamp('now'::text) + '@24hours'::interval

    That one should work.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #

pgsql-sql by date:

Previous
From: "tjk@tksoft.com"
Date:
Subject: Re: [SQL] select a part of a name
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Re: [SQL] subquery, except and view