Re: What should this query match? - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: What should this query match?
Date
Msg-id 200509141248.24909.peter_e@gmx.net
Whole thread Raw
In response to What should this query match?  (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>)
Responses Re: What should this query match?
List pgsql-sql
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/


pgsql-sql by date:

Previous
From: Joost Kraaijeveld
Date:
Subject: What should this query match?
Next
From: Joost Kraaijeveld
Date:
Subject: Re: What should this query match?