hive (union & subquery)

来源:互联网 发布:ssm框架oa系统源码 编辑:程序博客网 时间:2024/05/22 05:10

1) UNION ALL

select之间的columns必须相同,否则会报错;

2) SubQuery

a. 在from之后的子查询 

select id from (select id,zipcode from t1) t2;

b. 在where之后的子查询

select * from t1 where t1.id IN (select id from t2);

0 0