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 1BF28D8E49 for ; Wed, 14 Sep 2005 06:54:29 -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 56999-05 for ; Wed, 14 Sep 2005 09:54:20 +0000 (GMT) Received: from obelix.askesis.nl (laudanum.demon.nl [82.161.125.16]) by svr1.postgresql.org (Postfix) with ESMTP id F0185D8E5C for ; Wed, 14 Sep 2005 06:54:16 -0300 (ADT) Received: obelix.askesis.nl 172.31.0.1 from 172.31.1.8 172.31.1.8 via HTTP with MS-WebStorage 6.0.6249 Received: from Panoramix by obelix.askesis.nl; 14 Sep 2005 11:54:17 +0200 Subject: What should this query match? From: Joost Kraaijeveld To: "Pgsql-sql@postgresql.org" Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 14 Sep 2005 11:54:17 +0200 Message-Id: <1126691657.3675.5.camel@Panoramix> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.318 required=5 tests=[AWL=-0.202, FORGED_RCVD_HELO=0.05, TO_ADDRESS_EQ_REAL=0.47] X-Spam-Level: X-Archive-Number: 200509/147 X-Sequence-Number: 22694 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