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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

WHERE clause with timestamp data type



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






Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group