输入:
1
2
3
4
.
.
.
预期输出:
1
2
2
3
3
3
4
4
4
4
.
.
..
.
需要为期望的输出找到Hive / SQL查询,像这样
答案 0 :(得分:0)
下面是查询,已使用CTE和3条记录作为输入。
hive> with t1 as (select 1 as col1 union select 2 as col1 union select 3 as col1) select t11.col1 from t1 as t11,t1 as t12 where t11.col1>=t12.col1;