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

Browse pgsql-novice by date

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