本文介绍: hql如下select length(tag) from table1 order by length(tag) limit 20;报错FAILED: SemanticException [Error 10004]: Line…Invalid table alias or column reference ‘tag’: (possible column names are: _c0)FAILED: SemanticException [Error 10004]: Line…Invalid table
hql
如下
select length(tag) from table1 order by length(tag) limit 20;
报错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
中可以使用普通函数(如to_date()
),但是不能使用聚合函数(如count()
, sum()
)。
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。