X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4EFAE476346 for ; Wed, 12 Feb 2003 16:08:56 -0500 (EST) Received: from localhost.localdomain (Bb66d.pppool.de [213.7.182.109]) by postgresql.org (Postfix) with ESMTP id 00248475E30 for ; Wed, 12 Feb 2003 15:55:11 -0500 (EST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.11.6/8.11.6) with ESMTP id h1CKr9a06222; Wed, 12 Feb 2003 21:53:10 +0100 Content-Type: text/plain; charset="iso-8859-1" From: Nicholas Allen To: Bruno Wolff III Subject: Re: How do you select from a table until a condition is met? Date: Wed, 12 Feb 2003 21:53:08 +0100 User-Agent: KMail/1.4.1 Cc: Dmitry Tkach , pgsql-sql@postgresql.org References: <200302121910.38232.nallen@freenet.co.uk> <200302122055.21790.nallen@freenet.co.uk> <20030212203749.GA30483@wolff.to> In-Reply-To: <20030212203749.GA30483@wolff.to> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200302122153.08970.nallen@freenet.co.uk> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/262 X-Sequence-Number: 11660 Ok I thought of that but what happens if there is no primary key in the tab= le?=20 I can probably add primary keys to the table but I didn't design the tables= =20 and so I have little (but luckily some) say over what columns appear in the= m.=20 What has actually happened is that we have a view on a table and the view= =20 doesn't return the primary key. I'll try and ask the database administrato= r=20 to add the primary keys. Thanks for the help though I guess it is the only way to do it. I was just= =20 hoping there would be a way to do it without a promary key to prevent chang= es=20 to our database views. On Wednesday 12 Feb 2003 9:37 pm, Bruno Wolff III wrote: > On Wed, Feb 12, 2003 at 20:55:21 +0100, > > Nicholas Allen wrote: > > I thought of this but the problem is that there may be multiple rows wi= th > > the same value for the column I am sorting on. Eg if sorting on a surna= me > > then there may be 100s of people with the same surname so generating a > > where clause that selects up to the exact person previously selected is > > very difficult. > > Then you should sort on surname AND whatever you are using as the primary > key. > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org