Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by hub.org (8.10.1/8.10.1) with ESMTP id e8MF17s93652 for ; Fri, 22 Sep 2000 11:01:07 -0400 (EDT) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.3) with HTTP id 1091623 for ; Fri, 22 Sep 2000 08:01:06 -0700 From: "Josh Berkus" Subject: Re: [Fwd: Re: no ORDER BY in subselects?] To: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.3 Date: Fri, 22 Sep 2000 08:01:06 -0700 Message-ID: In-Reply-To: <3.0.5.32.20000921112954.00c9be00@mail.rhyme.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200009/182 Phillip, > The main reason I use them is to find the 'next' or > 'previous' record in a > list (eg. next date, next ID). eg. > The fact that Dec RDB, Oracle and SQL/Server all allow it > probably means > that there is a reasonable user base out there who think > it's a good idea. Makes sense. Fortunately, in PGSQL there's another function to grab the next ID. As for dates ... hmmm... there we come up against the "no subselect in FROM" bug, don't we? I get the problem. (Personally, I've always SELECTed into a variable in MSSQL rather than using the syntac you're suggesting. I've found that the order that the MSSQL chooses to execute query segments in can cause some unpredicatble results ... ) -Josh Berkus