pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>
To: Pgsql-sql@postgresql.org <Pgsql-sql@postgresql.org>
Subject: What should this query match?
Date: Wed, 14 Sep 2005 11:54:17 +0200
Message-ID: <1126691657.3675.5.camel@Panoramix> (raw)

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 





view thread (4+ messages)  latest in thread

Message-ID: <1126691657.3675.5.camel@Panoramix>
Permalink:  ../1126691657.3675.5.camel@Panoramix/
Also on:    postgresql.org/message-id/1126691657.3675.5.camel@Panoramix

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: J.Kraaijeveld@Askesis.nl
  Subject: Re: What should this query match?
  In-Reply-To: <1126691657.3675.5.camel@Panoramix>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox