vertica 列转行的sql

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

 

posted @ 2020-08-19 16:28  卡卡西村长  阅读(1036)  评论(0编辑  收藏  举报