X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 69DE8475C2B for ; Wed, 12 Feb 2003 15:24:28 -0500 (EST) Received: from wolff.to (wolff.to [66.93.249.74]) by postgresql.org (Postfix) with SMTP id A6294475C15 for ; Wed, 12 Feb 2003 15:24:27 -0500 (EST) Received: (qmail 30535 invoked by uid 500); 12 Feb 2003 20:37:49 -0000 Date: Wed, 12 Feb 2003 14:37:49 -0600 From: Bruno Wolff III To: Nicholas Allen Cc: Dmitry Tkach , pgsql-sql@postgresql.org Subject: Re: How do you select from a table until a condition is met? Message-ID: <20030212203749.GA30483@wolff.to> Mail-Followup-To: Nicholas Allen , Dmitry Tkach , pgsql-sql@postgresql.org References: <200302121910.38232.nallen@freenet.co.uk> <200302122010.15297.nallen@freenet.co.uk> <20030212193538.GA29724@wolff.to> <200302122055.21790.nallen@freenet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200302122055.21790.nallen@freenet.co.uk> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/257 X-Sequence-Number: 11655 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 with the > same value for the column I am sorting on. Eg if sorting on a surname 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.