On 4/8/2016 2:47 PM, hector(dot)bejarano(at)gmail(dot)com wrote:
> This query works:
> select 1 as a
>
> But this one fails:
> select 1 as a where a = 1
>
> And I think they should both work.
nope. doesn't work that way. Aliases to selected fields can not
be used in the WHERE clause, because the WHERE clause is executed BEFORE
the fields are selected and calculated.
this is per the SQL standard.
--
john r pierce, recycling bits in santa cruz