【发布时间】:2019-06-04 16:30:50
【问题描述】:
我试图参数化 hive 中的值,而不是在查询中对其进行硬编码。以下是查询。
select * from employee where sal >30000
但不是使用硬编码的 30000 值,我需要它来自如下相同的查询。但我遇到了问题:
select * from employee where sal > (select max(sal) from employee)
感谢任何帮助。
谢谢
【问题讨论】:
-
什么问题,收到任何错误或不返回任何数据?
-
接收到不支持的错误
-
试试表别名
select E.* from employee E where E.sal > (select max(S.sal) AS MaxSal from employee S) -
谢谢,但给出错误:无法识别附近的选择(