From: | Joost Kraaijeveld <J(dot)Kraaijeveld(at)Askesis(dot)nl> |
---|---|
To: | "Pgsql-sql(at)postgresql(dot)org" <Pgsql-sql(at)postgresql(dot)org> |
Subject: | What should this query match? |
Date: | 2005-09-14 09:54:17 |
Message-ID: | 1126691657.3675.5.camel@Panoramix |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(dot)Kraaijeveld(at)Askesis(dot)nl
web: www.askesis.nl
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2005-09-14 10:48:24 | Re: What should this query match? |
Previous Message | gherzig | 2005-09-13 18:09:42 | Re: refer a column as a varible name? |