Abt*_*Pst 1 sql union hive hiveql hive-query
我正在尝试在 hive 中运行 union all 查询
select * from tabName where col1='val1' and col2 = 'val2' limit 10 union all select * from tabName where col1='val1' and col2 = 'val3' limit 10;
Run Code Online (Sandbox Code Playgroud)
但我明白了
FAILED: ParseException line 1:105 missing EOF at 'union' near '10'
Run Code Online (Sandbox Code Playgroud)
我也试过
( select * from tabName where col1='val1' and col2 = 'val2' limit 10 ) as a union all ( select * from tabName where col1='val1' and col2 = 'val3' limit 10 ) as b;
Run Code Online (Sandbox Code Playgroud)
但我得到了
FAILED: ParseException line 1:109 missing EOF at 'as' near ')'
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么 ?
使用从子查询中选择:
select * from
( select * from tabName where col1='val1' and col2 = 'val2' limit 10 ) a
union all
select * from
( select * from tabName where col1='val1' and col2 = 'val3' limit 10 ) b;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1059 次 |
| 最近记录: |