标签: sql postgresql
需要将Table1 Col1值插入到Table2 Col1中:
输入:
Table1 Col1 1,2,3,4
输出:
Table2 Col1 1 2 3 4
答案 0 :(得分:1)
使用regexp_split_to_table():
regexp_split_to_table()
select val from table1 t1 cross join lateral regexp_split_to_table(t1.col1, ',') val;