X-Original-To: pgsql-sql@postgresql.org Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id 8917E4762FE for ; Wed, 5 Mar 2003 09:49:19 -0500 (EST) Received: from lamer.pl (localhost [127.0.0.1]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 0306F2B88F; Wed, 5 Mar 2003 15:47:25 +0100 (CET) From: "Tomasz Myrta" To: Gary Stainburn , pgsql-sql@postgresql.org Subject: Re: sort / limit / range problem Date: Wed, 5 Mar 2003 15:47:24 +0800 Message-Id: <20030305154724.M33531@klaster.net> In-Reply-To: <200303051437.47161.gary.stainburn@ringways.co.uk> References: <200303051437.47161.gary.stainburn@ringways.co.uk> X-Mailer: Open WebMail 1.62 20020221 X-OriginatingIP: 217.96.97.171 (jasiek) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 X-Archive-Number: 200303/157 X-Sequence-Number: 12197 > Hi folks, > > I've got a glossary table that I'm trying to render to HTML. > However, I've got a problem when using order by and limit. Below > is an example of a psql session showing my problem. Anyone got any > reasons why the last select misses 'Driver'? > Everything is ok. Without order by, limit has undeterminated result. It is described in Postgresql documentation. Try this: select glterm from glossary where glterm > 'Driving Wheels' order by glterm limit 1 select glterm from glossary where glterm > 'Draw Bar' order by glterm limit 1 Regards, Tomasz Myrta