2023-08-24
阅读量:
13963
hive QL里面,where>后面怎么加子查询
如下图,在oracle sql developer里面有一张商品价格表(字段bq是本期价格的意思)
现在要查询所有商品中价格大于所有商品平均价格的记录。
如果是在mysql里面可以这么写:
select * from tb where bq >(select avg(bq) as pingjun from (select jcmc,bq,1 as logo from tb) tmp group by logo);
但是Hive 里面的where 后面加子查询,好像不能用大于号。
咋整?各位 老铁指教指教。






评论(3)

推荐帖子
0条评论
0条评论
0条评论