Tuesday, October 4, 2011

How to use alias in the WHERE or GROUP BY clause

One workaround would be to use a derived table:



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

No comments:

Post a Comment