Search Postgresql Archives

Re: extract day from interval

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

 



Seb <spluque@xxxxxxxxx> writes:
>        EXTRACT(DAY FROM (table_b.date - table_a.date)) AS age,

> Is this an efficient way to get the days from the time interval?  Both
> 'date' columns are of type "Date".  Thanks.

Efficiency is moot, it's just plain wrong.  Or at least something is
wrong here, Subtraction of two "date" values gives an integer number of
days already, so I'd expect the EXTRACT to fail altogether.  You
sure the date columns are type date and not type timestamp?

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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