Re: Hour difference? - Mailing list pgsql-general

From Bjørn T Johansen
Subject Re: Hour difference?
Date
Msg-id 1061241662.2704.171.camel@pennywise.havleik.no
Whole thread Raw
In response to Re: Hour difference?  (Steve Worsley <sworsley@commandprompt.com>)
List pgsql-general
Well, that might help, thanks... :)

BTJ

On Mon, 2003-08-18 at 20:47, Steve Worsley wrote:
> fingerless=# select '7:43'::time AS start, '12:17'::time AS end,
> (('12:17'::time) - ('7:43'::time))::interval AS difference;
>   start   |   end    | difference
> ----------+----------+------------
>  07:43:00 | 12:17:00 | 04:34
> (1 row)
>
>
> Hope that helps.. Just subsitute your column names for the times.
>
> --Steve
>
>
> Bjørn T Johansen wrote:
>
> >I need to compute the difference of Time fields, in the format HHMM. Is
> >it possible to do the math in the Select?
> >
> >
> >Regards,
> >
> >BTJ
> >
> >
> >



pgsql-general by date:

Previous
From: Jenny Zhang
Date:
Subject: factors determining the execution plan
Next
From: Tom Lane
Date:
Subject: Re: Cache lookup failed?