首先我使用了查询:
select name
from tab1
where id in (select id
from (select id,count(id) as a
from tab2
group by id
order by a desc limit 1) ;
我知道在Hive里选择是不可能的。所以我用变量修改了它。
set var1= select count(id) as a from tab2 group by id order by a desc limit 1;
select name from tab1 group by name having count(id)='${hiveconf:var1}';
但是在 '${hiveconf:var1}'
,查询被替换,再次得到相同的错误。
有什么办法吗?
1条答案
按热度按时间2admgd591#