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

WHERE clause with timestamp data type

From: Chirag Patel <patelc75(at)yahoo(dot)com>
To: PostgreSQL Novice List <pgsql-novice(at)postgresql(dot)org>
Subject: WHERE clause with timestamp data type
Date: 2007-08-27 04:49:29
Message-ID: 588009.30252.qm@web52811.mail.re2.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
The following command works great,
SELECT AVG(column) FROM table WHERE timestamp > 2007-08-23;

But when I try it with finer resolution (hour, minutes, seconds) like this, I get a syntax error
SELECT AVG(heartrate) FROM heartrates WHERE timestamp > 2007-08-23 19:48:09;

Do I need to convert from string format to total number of seconds? Any ideas on how to get this work?

Thanks!
Chirag




Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2007-08-27 05:10:50
Subject: Re: WHERE clause with timestamp data type
Previous:From: Oliveiros CristinaDate: 2007-08-24 13:50:42
Subject: Re: How to import a csv

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