scope of alias variables (was: Re: Views on the outcomes of F2F)

>  > **  ISSUE-39: Variable scope of alias variables
>  >
>  > Consensus that variables on the right-hand side of "AS" (alias 
> variables) are not in scope for the rest of the query (including 
> projected expressions), but not including outer queries of course.
> 
> Disagree - this is an unnecessary restriction and results in needing 
> addition nesting of SELECTs just to reuse an expression.

What's an example of this? Does this only apply when an expression has 
side-effects or does not evaluate the same when invoked twice?

This was driven in part, I believe, by what existing implementations did 
that were discussed at the F2F.

In an alternate design, what is the scope of alias variables? Where 
can/can't they be used?

Lee

Received on Friday, 13 November 2009 04:53:57 UTC