select * from tbl where id=2

union 

select * from tbl where id =1

 

如果hive使用union这么查询的时候,我们会发现数据变乱了。

解决办法就是在select后边实际写上列名,就没有问题了,例如:

select column1,column2 from tbl where id=2

union 

select column1,column2 from tbl where id =1

相关文章: