有没有办法在查询中稍后使用的列别名?我有类似的东西
select item_id,
sum(sales) as total_sales,
sum(cost) as total_cost
total_sales - total_cost as total_profit
from table A
group by item_id,total_profit;
我尝试使用
SET hive.groupby.orderby.position.alias=true;
但不起作用。
我知道我可以在Teradata中这样做,所以我希望在Hive中必须有一些方法可以做到这一点。
感谢,
Manoj Agrawal