首页 > 其他 > 详细

Hive进阶_Hive的子查询

时间:2017-01-24 15:58:37      阅读:122      评论:0      收藏:0      [点我收藏+]

- 集合中如果含null数据,不可使用not in, 可以使用in
- hive只支持where和from子句中的子查询
- 主查询和自查询可以不是同一张表

select e.ename
from emp e
where e.deptno in
(
select d.deptno from dept d where d.dname=SALES or d.dname=ACCOUNTING
);

 

select *
from emp e
where e.deptno not in
(
select e1.mgr from emp e1 where e1.mgr is not null
);

 

Hive进阶_Hive的子查询

原文:http://www.cnblogs.com/liupuLearning/p/6347120.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!