all groups > sql server new users > february 2005 >
You're in the

sql server new users

group:

Column Name Fail in Mssql


Re: Column Name Fail in Mssql Walter Clayton
2/27/2005 11:07:32 PM
sql server new users:
I'm not certain that exact form runs on JET. Then again, I tend to keep SQL
on JET extremely simple. :-)

The problem is scope of reference. There are two basic ways (and several
flavors between) to do what you want:

--The kludgy way, albeit that depends on the intended maintainability
select (1+2) as t1
, (1+2) * 2 as t2
, ((1+2) * 2) * 3 as t3
from tab;

--or--
select d_t2.t1 t1
, d_t2.t2 t2
, d_t2.t2 * 3 t3
from
(
select d_t1.t1 t1
, d_t1.t1*2 t2
from
(
select (1+2) t1
from abc
) d_t1
) d_t2
;

--
Walter Clayton
Any technology distinguishable from magic is insufficiently advanced.


[quoted text, click to view]
Column Name Fail in Mssql Vincent
2/28/2005 11:43:08 AM
In access:
select (1+2) as T1, (T1*2) as T2, (T2 *3) as T3 from abc : OK
But why it can not be run at mssql 2000.

AddThis Social Bookmark Button