From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chris Ruprecht <chrup999@yahoo.com>
Cc: psql <pgsql-sql@postgresql.org>
Subject: Re: Select question
Date: Wed, 23 May 2001 12:18:30 -0400
Message-ID: <15035.990634710@sss.pgh.pa.us> (raw)
In-Reply-To: <00a801c0e38b$94792320$5dd26383@corp.compucom.com>
References: <00a801c0e38b$94792320$5dd26383@corp.compucom.com>
"Chris Ruprecht" <chrup999@yahoo.com> writes:
> phone=# select * from phonelog where cdate > 2001-05-18 order by cdate limit
> 2 ;
Try
select * from phonelog where cdate > '2001-05-18' order by cdate limit 2
I think it's interpreting your query as where cdate > 1978 (result of
integer subexpression) and then doing some weird integer-to-date
conversion. In general, any constant of a non-numeric datatype needs
to be quoted in SQL queries.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, chrup999@yahoo.com
Subject: Re: Select question
In-Reply-To: <15035.990634710@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox