Received: from amsterdam.execulink.net ([199.166.6.19]) by hub.org (8.10.1/8.10.1) with ESMTP id e8LFmJs50544 for ; Thu, 21 Sep 2000 11:48:19 -0400 (EDT) Received: from BAX8 (ppp53.d2-2.56k.execulink.com [209.239.21.117]) by amsterdam.execulink.net (8.9.3/8.9.3) with SMTP id LAA13690 for ; Thu, 21 Sep 2000 11:48:13 -0400 (EDT) Message-Id: <3.0.6.32.20000921115010.0097e1b0@execulink.com> X-Sender: fbax@execulink.com X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Date: Thu, 21 Sep 2000 11:50:10 -0400 To: pgsql-sql@postgresql.org From: Frank Bax Subject: Re: [Fwd: Re: no ORDER BY in subselects?] In-Reply-To: <3.0.5.32.20000921112954.00c9be00@mail.rhyme.com.au> References: <39C8E3C9.D1CFFDB3@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Archive-Number: 200009/166 At 11:29 AM 9/21/00 +1000, you wrote: >The main reason I use them is to find the 'next' or 'previous' record in a >list (eg. next date, next ID). eg. > > select , (select ID from table where id > this.id > order by id asc limit 1) as next_id ... Doesn't this give the same result (without order by): > select , (select min(ID) from table where id > this.id) as next_id Frank