hql如下
select length(tag) from table1 order by length(tag) limit 20;
報(bào)錯(cuò)
FAILED: SemanticException [Error 10004]: Line...Invalid table alias or column reference 'tag': (possible column names are: _c0)
修改
用別名替代length(tag), 如下
select length(tag) as taglen from table1 order by taglen limit 20;
在order by中可以使用普通函數(shù)(如to_date()),但是不能使用聚合函數(shù)(如count(), sum())。