Re: What should this query match?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Joost Kraaijeveld <J(dot)Kraaijeveld(at)askesis(dot)nl>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: What should this query match?
Date: 2005-09-14 10:48:24
Message-ID: 200509141248.24909.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joost Kraaijeveld 2005-09-14 11:09:22 Re: What should this query match?
Previous Message Joost Kraaijeveld 2005-09-14 09:54:17 What should this query match?