Re: fomatting an interval (resend) - Mailing list pgsql-general

From lyris-pg@tibit.com
Subject Re: fomatting an interval (resend)
Date
Msg-id 7jucdvsvcuefau6lnj5t9mdftu8h07v00f@4ax.com
Whole thread Raw
In response to Re: fomatting an interval  (lyris-pg@tibit.com)
Responses Re: fomatting an interval (resend)
List pgsql-general
>> Okay, so extract() doesn't fit the bill either.  How do I get the
>> difference between two timestamps in terms of days, expressed as an
>> integer?  Moreover, how do I get any interval expressed in those
>> terms?
>
>select round((extract(epoch from finish) - extract(epoch from start))/(60*60*24))
>  from timetable;

How would that differ from the query below?

select round(extract(epoch from (finish - start))/(60*60*24)) from
timetable;


pgsql-general by date:

Previous
From: "Jay O'Connor"
Date:
Subject: Re: PLPGSQL problem with SELECT INTO
Next
From: Tom Lane
Date:
Subject: Re: PLPGSQL problem with SELECT INTO