Error with a SQL query 'between .. and .. and'

From: Turbo Fredriksson <turbo(at)bayour(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Error with a SQL query 'between .. and .. and'
Date: 2002-02-21 08:58:53
Message-ID: 873czv6wj6.fsf@papadoc.bayour.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This SQL query works in 7.1.3, but not in 7.2, how come?

select count(*) from log where starttime between now()-interval(60*60) and now() and statuscode='2';
ERROR: parser: parse error at or near "*"

If I precalculate 60*60, I get this:

select count(*) from log where starttime between now()-interval(3600) and now() and statuscode='2';
ERROR: parser: parse error at or near "and"

nuclear supercomputer explosion Marxist FBI Iran SEAL Team 6 quiche
Qaddafi nitrate class struggle South Africa counter-intelligence
attack Ortega
[See http://www.aclu.org/echelonwatch/index.html for more about this]

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak 2002-02-21 09:06:22 Re: elog() proposal
Previous Message Oliver Elphick 2002-02-21 08:19:02 Re: foreign key is from different tables - what to do?