X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 17F93D8E85 for ; Wed, 14 Sep 2005 07:48:44 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63970-09 for ; Wed, 14 Sep 2005 10:48:36 +0000 (GMT) Received: from gauss.credativ.com (ipx11302.ipxserver.de [212.112.227.254]) by svr1.postgresql.org (Postfix) with ESMTP id C9C78D8E77 for ; Wed, 14 Sep 2005 07:48:37 -0300 (ADT) Received: from bell.credativ.de (p50897AAB.dip.t-dialin.net [80.137.122.171]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by gauss.credativ.com (Postfix) with ESMTP id 5BDB4D78A2; Wed, 14 Sep 2005 12:48:38 +0200 (CEST) From: Peter Eisentraut To: Joost Kraaijeveld Subject: Re: What should this query match? Date: Wed, 14 Sep 2005 12:48:24 +0200 User-Agent: KMail/1.8.1 Cc: pgsql-sql@postgresql.org References: <1126691657.3675.5.camel@Panoramix> In-Reply-To: <1126691657.3675.5.camel@Panoramix> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509141248.24909.peter_e@gmx.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 required=5 tests=[AWL=-0.000, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/148 X-Sequence-Number: 22695 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/