Use value of a column for another column (SQL Server)?

后端 未结 4 1653
死守一世寂寞
死守一世寂寞 2021-02-19 00:02

lets say I have a huge select on a certain table. One value for a column is calculated with complex logc and its called ColumnA. Now, for another column, I need the val

4条回答
  •  渐次进展
    2021-02-19 00:26

    Unfortunately, in SQL Server 2016:

    SELECT 3 AS a, 6/a AS b;
    

    Error: Invalid column name: 'a'.

提交回复
热议问题