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

From Joost Kraaijeveld
Subject What should this query match?
Date
Msg-id 1126691657.3675.5.camel@Panoramix
Whole thread Raw
Responses Re: What should this query match?
List pgsql-sql
Hi,


Should the follwing query match a record with just "Jan" in the column
(there are no nulls in the column and there are 2 records with only
"Jan" in it) ?

SELECT COUNT(*) FROM customers 
WHERE lower(lastName) < lower('Jan%')

If so, and if the result of the previous question  is "144660", should
the next query display "Jan"?

SELECT lastname FROM prototype.customers 
ORDER BY lower(lastname)
LIMIT  1 OFFSET 144600

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%')

TIA


-- 
Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl 




pgsql-sql by date:

Previous
From: gherzig@fmed.uba.ar
Date:
Subject: Re: refer a column as a varible name?
Next
From: Peter Eisentraut
Date:
Subject: Re: What should this query match?