Re: [GENERAL] TIMESTAMP difference

2007-12-10 Thread Rodrigo De León
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

[GENERAL] TIMESTAMP difference

2007-12-10 Thread rihad
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