X-Original-To: pgsql-sql@postgresql.org Received: from stan.ringways.co.uk (hub.ringways.co.uk [213.38.87.130]) by postgresql.org (Postfix) with ESMTP id B78314762E9 for ; Wed, 5 Mar 2003 11:03:37 -0500 (EST) Received: from gary.ringways.co.uk ([10.1.1.2]) by stan.ringways.co.uk with esmtp (Exim 3.22 #1) id 18qbKn-0006bV-00; Wed, 05 Mar 2003 16:01:33 +0000 Content-Type: text/plain; charset="iso-8859-1" From: Gary Stainburn Organization: Ringways Garages Ltd To: Achilleus Mantzios Subject: Re: sort / limit / range problem Date: Wed, 5 Mar 2003 16:00:12 +0000 User-Agent: KMail/1.4.3 References: In-Reply-To: Cc: "Tomasz Myrta" , pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200303051600.12841.gary.stainburn@ringways.co.uk> X-Archive-Number: 200303/162 X-Sequence-Number: 12202 On Wednesday 05 Mar 2003 6:59 pm, you wrote: > On Wed, 5 Mar 2003, Gary Stainburn wrote: > > 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'? > > You forgot ORDER BY glterm Thanks you too, sometimes you can't see the wood for the trees Gary > > > nymr=# select glterm from glossary where glterm like 'D%' order by > > glterm; glterm > > ---------------- > > Dampers > > Dart > > Detonators > > Disposal > > Dome > > Draw Bar > > Driver > > Driving Wheels > > Duty Fitter > > (9 rows) > > > > nymr=# select glterm from glossary where glterm > 'Driving Wheels' limit > > 1; glterm > > ------------- > > Duty Fitter > > (1 row) > > > > nymr=# select glterm from glossary where glterm > 'Draw Bar' limit 1; > > glterm > > ---------------- > > Driving Wheels > > (1 row) > > > > nymr=# \d glossary > > Table "glossary" > > Attribute | Type | Modifier > > -----------+-----------------------+------------------------------------- > >---------------- glid | integer | not null default > > nextval('glossary_glid_seq'::text) > > glterm | character varying(30) | not null > > gldesc | text | > > Indices: glossary_pkey, > > glossary_term_index > > > > nymr=# -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000