Skip to content
Advertisement

How to alias column into another operation

I want to use the Elias column startdate into anthor operation to calculate

Advertisement

Answer

Use CROSS APPLY to define the alias in the FROM clause. Then it is available throughout the query:

Note that I added table aliases so the query is easier to write and read.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement