Sql – Using an Alias column in the where clause in ms-sql 2000


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:

Best Solution

One workaround would be to use a derived table.

For example:

select *
   select a + b as aliased_column
   from table
   ) dt
where dt.aliased_column = something.

I hope this helps.