From: Peter Eisentraut <peter_e@gmx.net>
To: Joost Kraaijeveld <J.Kraaijeveld@askesis.nl>
Cc: pgsql-sql@postgresql.org
Subject: Re: What should this query match?
Date: Wed, 14 Sep 2005 12:48:24 +0200
Message-ID: <200509141248.24909.peter_e@gmx.net> (raw)
In-Reply-To: <1126691657.3675.5.camel@Panoramix>
References: <1126691657.3675.5.camel@Panoramix>
Am Mittwoch, 14. September 2005 11:54 schrieb Joost Kraaijeveld:
> Why do the following queries return the same count (may be related to
> the first question)
>
> SELECT COUNT(*) FROM customers
> WHERE lower(lastName) < lower('Jan%')
>
> SELECT COUNT(*) FROM customers
> WHERE lower(lastName) <= lower('Jan%')
These queries should return the same answer if the query does not contain the
value 'Jan%' (or differently capitalized versions). I suspect that you are
actually attempting to use % as a wild card, but none of your queries use a
pattern matching operator, so I'd go back and check if your queries really
are what you think they should be.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
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: peter_e@gmx.net, J.Kraaijeveld@askesis.nl
Subject: Re: What should this query match?
In-Reply-To: <200509141248.24909.peter_e@gmx.net>
* 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