Skip site navigation (1) Skip section navigation (2)

sum timestamp result in hours

From: paulo matadr <saddoness(at)yahoo(dot)com(dot)br>
To: pgsql-sql(at)postgresql(dot)org
Subject: sum timestamp result in hours
Date: 2008-11-07 14:20:29
Message-ID: 438124.7593.qm@web52506.mail.re2.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-sql
Select sum(age(rgat.rgat_tmencerramento, rgat.rgat_tmregistroatendimento))
from atendimentopublico.registro_atendimento rgat
inner join cadastro.localidade loca on loca.loca_id=rgat.loca_id
inner join atendimentopublico.solicitacao_tipo_especificacao step on step.step_id=rgat.step_id
where
date(rgat_tmregistroatendimento) between '2007-01-01' and '2007-12-31'
and rgat.step_id in (706,710,717,718,719,722,725,728,730,732,733,720,721,727,714,729)
and rgat.rgat_cdsituacao=2
and date(rgat_tmencerramento) between '2007-01-01' and '2007-12-31'
and rgat.rgat_tmencerramento > rgat.rgat_tmregistroatendimento
and rgat.loca_id=339
and rgat.rgat_id in
(20111305,
30102409,
30102096,
30097214,
30102396,
20057815,
20325895)
Result: 1 year 4 mons 88 days 51:42:00

I need help to view result query only in hours, the timestamp columns in  bold above.
thanks
Paulo Moraes


      Novos endere├žos, o Yahoo! que voc├¬ conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses

Responses

pgsql-sql by date

Next:From: paulo matadrDate: 2008-11-07 16:36:01
Subject: Res: sum timestamp result in hours
Previous:From: paulo matadrDate: 2008-11-07 14:15:49
Subject: Res: Finding all tables that have foreign keys referencing a table

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group