Re: date subtraction - Mailing list pgsql-sql

From Richard Huxton
Subject Re: date subtraction
Date
Msg-id 423E80B6.808@archonet.com
Whole thread Raw
In response to date subtraction  (Ashok Agrawal <Ashok.Agrawal@Sun.COM>)
List pgsql-sql
Ashok Agrawal wrote:
> I need to do date calculation similar to oracle in postgres.
> 
> like sysdate - creation_date of the record which returns no
> of days in oracle which you can convert to hours or second
> by multiplying by 60 or 3600.
> 
> How do i achieve this in postgres.

Umm,  SELECT CURRENT_DATE - creation_date FROM my_table;

--   Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Trigger with parameters
Next
From: Mihail Nasedkin
Date:
Subject: index scan