Re: Question on Structuring Product Attributes

From: James K. Lowden <jklowden_at_speakeasy.net>
Date: Sun, 10 Feb 2013 19:38:51 -0500
Message-Id: <20130210193851.f84e96df.jklowden_at_speakeasy.net>


On Sat, 09 Feb 2013 19:36:01 +0100
Lennart Jonsson <erik.lennart.jonsson_at_gmail.com> wrote:

> My understanding is that a query is - logically - evaluated in the
> following order:
>
> 1. FROM (JOIN)
> 2. WHERE (ON)
> 3. GROUP BY -- irrelevant here
> 4. HAVING -- irrelevant here
> 5. SELECT (Projection)
> 6. ORDER BY
Except #6. ORDER BY, strictly speaking, returns a cursor, not a virtual table. Logically, it's a post-processor for the SELECT statement. That's why it can't be included in subqueries.

> Given the query:
>
> SELECT COALESCE(1, 0) FROM T WHERE 1=0
>
> there is nothing that we can apply COALESCE on. We have to create
> something from nothing in order to return 0.

Absolutely so. But YMMV. You know what they say,

	"In theory there's no difference between theory and practice. 
	 In practice, there is."

--jkl Received on Mon Feb 11 2013 - 01:38:51 CET

Original text of this message