查询:SELECT DISTINCT seg from mytable ORDER BY 1 ASC
结果
+-------+--+
| seg |
+-------+--+
| NONE |
| AFS |
+-------+--+
作为
SELECT DISTINCT seg from mytable ORDER BY seg ASC
的结果+-------+--+
| seg |
+-------+--+
| AFS |
| NONE |
+-------+--+
Hive不支持在ORDER BY中按位置引用列吗?
最佳答案
自Hive 0.11起支持按位置排序,但仅从Hive 2.2.0起默认启用。
https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties