有没有办法使用查询稍后声明的列别名?我有这样的东西
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 中也必须有一些方法可以做到这一点。
谢谢,
马诺伊阿格拉瓦尔