列转行(Hive列转行)
生活随笔
收集整理的這篇文章主要介紹了
列转行(Hive列转行)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
test: c1 c2 1 a 1 b 2 c select to_char(wmsys.wm_concat(c2)) , to_char(replace(wmsys.wm_concat(c2),,,/)) from test group by c1 show case: 1 a,b a/b 2 c c 同樣的功能函數(shù): select listagg(c2,,) within group(order by c1) from test ;
test:
c1 c2
1 a
1 b
2 c
select
to_char(wmsys.wm_concat(c2)) ,
to_char(replace(wmsys.wm_concat(c2),',','/'))
from
test
group by
c1
show case:
1 a,b a/b
2 c c
同樣的功能函數(shù):
select listagg(c2,',') within group(order by c1) from test ;
總結(jié)
以上是生活随笔為你收集整理的列转行(Hive列转行)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 公众平台模板消息所在行业_微信公众号模板
- 下一篇: 全军出击操作设置怎么弄