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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-novice by date

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