Search Postgresql Archives

Re: subtracting minutes from date

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 23, 2006 at 13:55:34 -0600,
  Brandon Metcalf <bmetcalf@xxxxxxxxxx> wrote:
> 
> If I have a column called date with data type timestamp without time
> zone I know I can use
> 
>   SELECT * FROM table WHERE date < (now()::DATE - 7)::TIMESTAMP;

You can do this without converting to timestamp:
SELECT * FROM table WHERE date < current_date - 7;


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux