On Dec 10, 2007 2:13 PM, rihad <[EMAIL PROTECTED]> wrote:
> Hi, is there a way to get the difference in hours between two
> timestamps?
SELECT (EXTRACT (EPOCH FROM TIMESTAMP '20071211 00:00') - EXTRACT
(EPOCH FROM TIMESTAMP '20071209 01:00')) * INTERVAL '1 second';
---(end
Hi, is there a way to get the difference in hours between two
timestamps? The HH{1,}:MM:SS format will do.
foo=> select timestamp '20071211 00:00' - timestamp '20071210 00:01';
?column?
--
23:59:00
(1 row)
foo=> select timestamp '20071211 00:00' - timestamp '20071209 01:00';
?colu