vertica 列转行的sql

时间:2020-08-19 21:54:56   收藏:0   阅读:265
with
t1 as (select 1 as id union all select 2 union all select 3 union all select 4 union all select 5),
t2 as (select 100,200,300 as client_id)

select
  t1.id,
  regexp_substr(t2.client_id, \d{3}, 1, t1.id) as client_id
from t2
join t1 on 1=1
order by t1.id

 

原文:https://www.cnblogs.com/lavezhang/p/13530080.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!