Re: [Fwd: Re: no ORDER BY in subselects?] - Mailing list pgsql-sql

From Josh Berkus
Subject Re: [Fwd: Re: no ORDER BY in subselects?]
Date
Msg-id web-1091623@davinci.ethosmedia.com
Whole thread Raw
In response to Re: [Fwd: Re: no ORDER BY in subselects?]  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: root
Date:
Subject: how to store a query, that results in a table
Next
From: Tom Lane
Date:
Subject: Re: sql query not using indexes