tsql - How to refer to a variable create in the course of executing a query in T-SQL, in the WHERE clause? -


what title says, really.

if select [statement] whatever, why can't refer whatever column in body of clause? there kind of workaround? it's driving me crazy.

as far i'm aware, can't directly in sql server.

if have use column alias in clause, can this, seems overkill use subquery alias:

select *  (     select [yourcolumn] youralias, etc...    whatever ) yoursubquery youralias > 2 

you're better off using contents of original column in clause.


Comments

Popular posts from this blog

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

xslt - Umbraco and EXSLT sets do not work -

php - How can I merge Nodes & Webform Submissions into instances of one general Content Type in Drupal 6? -