我想使用别名列作为select子句中的另一列。
select col_1/col_2+col_3 as new_col,
new_col+10 as new_col_2
from table
答案 0 :(得分:3)
您可以使用子查询来实现:
select new_col, new_col + 10 as new_col_2
from (
select col_1 / col_2 + col_3 as new_col
from table
) t