如何在配置单元查询的后续部分中使用列别名

时间:2017-01-04 00:25:55

标签: hadoop hive column-alias

有没有办法在查询中稍后使用的列别名?我有类似的东西

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

0 个答案:

没有答案