当前查询,不起作用:
select datetime as a
from coffee_chain
order by datetime;
有人知道原因吗。
答案 0 :(得分:0)
使用
select datetime as a from coffee_chain order by a;
https://issues.apache.org/jira/browse/HIVE-1449
hive> create table coffee_chain (datetime int);
OK
hive> select datetime as a from coffee_chain order by datetime;
FAILED: SemanticException Line 0:-1 Invalid table alias or column reference 'datetime': (possible column names are: a)
hive> select datetime as a from coffee_chain order by a;
OK