| From: | lyris-pg(at)tibit(dot)com |
|---|---|
| To: | greg(at)turnstep(dot)com |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: fomatting an interval |
| Date: | 2003-05-23 01:07:55 |
| Message-ID: | 8rsqcv87sac2c1hh6nqkg0dj4cminlbo7r@4ax.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general pgsql-hackers |
>> 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 the following differ from the query above?
select round(extract(epoch from (finish - start))/(60*60*24)) from
timetable;
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bruno Wolff III | 2003-05-23 01:45:50 | Re: tablemeta-data |
| Previous Message | Tom Lane | 2003-05-23 00:00:14 | Re: Q: Structured index - which one runs faster? |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Christopher Kings-Lynne | 2003-05-23 02:28:59 | Un-clustering an index |
| Previous Message | Sean Chittenden | 2003-05-23 01:05:38 | Re: $PostgreSQL$ for revision info |