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

Seconds To Time

From: Willem de Jong <Jong(at)dnaservices(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Seconds To Time
Date: 2004-05-11 08:08:34
Message-ID: Xns94E66746D6F29Jongdatdnaservicesdo@ (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
Hi all, 

I'm a newby to PGSQL, I allways use MySQL, but now we use PGSQL, so i had 
to convert all the MySQL-Query's to PGSQL.

In MySQL we have the function Sec_to_time(seconds). This will result a 
time-value like '40:30:00'. 

With this Query
SELECT TIMESTAMP WITH TIME ZONE 'epoch' + sum(elapsed)/1000 * interval '1 
second' from Table1 GROUP BY ...
The result is a timestamp from the unixtime + the seconds elapsed.

How can I convert this to a time-value? 

Thanks in advance

pgsql-sql by date

Next:From: Bruce MomjianDate: 2004-05-11 13:44:26
Subject: Re: Adding MERGE to the TODO list (resend with subject)
Previous:From: Riccardo FacchiniDate: 2004-05-11 07:46:22
Subject: Re: Trigger function to know which fields are being updated

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