Re: Question on Structuring Product Attributes

From: Derek Asirvadem <derek.asirvadem_at_gmail.com>
Date: Mon, 11 Feb 2013 00:05:46 -0800 (PST)
Message-ID: <30e89251-d2a5-425c-a556-7c76f034ed91_at_googlegroups.com>


On Monday, 11 February 2013 11:38:51 UTC+11, James K. Lowden wrote:
>
> Except #6. ORDER BY, strictly speaking, returns a cursor, not a
> virtual table.

Let me assure that my platform Sybase does NOT use a cursor; it does not use a virtual table or a derived table or an inline table either. It uses an internal worktable (two columns: the ORDER BY key and a pointer to the result set). Same with MS SQL until 2008. Same with DB2 (not LUW) until four years ago.

In 2013, I would say using a cursor for such an operation is a very primitive thing to do.

> Logically, it's a post-processor for the SELECT
> statement. That's why it can't be included in subqueries.

Ok, so scalar subqueries (single row, single column) are excluded in this discussion, otherwise your point would be moot.

Isn't ORDER only relevant to the *outermost* query ? When would ORDER BY be relevant in a subquery (and therefore the prohinbition of it be relevant) ?

> You know what they say,
> "In theory there's no difference between theory and practice.
> In practice, there is."

Yeah, sure.

The issue, I think, is difference between implementations (platforms), which is being discussed at length. How does the [cerebral or temporal] difference between theory and practice apply to that ?

Cheers
Derek Received on Mon Feb 11 2013 - 09:05:46 CET

Original text of this message