I know you cannot use a alias column in the where clause for T-SQL; however, has Microsoft provided some kind of workaround for this?
Related Questions: Unknown Column In Where Clause Can you use an alias in the WHERE clause in mysql? “Invalid column name” error on SQL statement from OpenQuery results
Related Questions:
One workaround would be to use a derived table.
For example:
select * from ( select a + b as aliased_column from table ) dt where dt.aliased_column = something.
I hope this helps.
1.4m articles
1.4m replys
5 comments
57.0k users