name A.subject A.grade
Michael Math 69
Michael Natural Sciences 43
name B.subject B.grade
Michael History 99
Michael Geography 23
到
name subject grade
Michael Math 69
Michael Natural Sciences 43
Michael History 99
Michael Geography 23
如何在hivesql中实现它?谢谢。。。。。。。。。。。。。。。。。。。。
2条答案
按热度按时间goqiplq21#
你可以用
union all
```select
name,
a.subject,
a.grade
from yourTableA a
union all
select
name,
b.subject,
b.grade
from yourTableB b
t9eec4r02#
使用
Union ALL
```select name, A.subject, A.grade from tablename A
union all
select name, B.subject, B.grade from tablename B