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

convert time format retuned by a select query

From: Johan Martinez <jmartiee(at)gmail(dot)com>
To: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: convert time format retuned by a select query
Date: 2011-12-08 22:45:52
Message-ID: CA+jMyfr2UGczBf6hbn+rXKhS2HctbHyLxpg9iw1wtcdRq1s1XA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
I would like to subtract two columns - create_time and update_time of
'timestamp without time zone' type and then order results based on
subtraction-result (time interval). I checked
http://www.postgresql.org/docs/current/static/functions-datetime.html ,
however these examples didn't work with actual column values. e.g.something
like:
'select epoch (update_time) - epoch (create_time) AS Column1 from users
order by Column1; '

Any hints or documentation liks will be really nice. Thanks.

jM

Responses

pgsql-novice by date

Next:From: Michael RowanDate: 2011-12-08 22:53:31
Subject: pgAdmin3 grant wizard question
Previous:From: Steve CrawfordDate: 2011-12-08 16:01:36
Subject: Re: Big wide datasets

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