Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我{1,10000,30} 在 PostgreSQL 数据库中插入元素数组 {idno,age,salary} ,我需要拆分并存储到表的相关列中。
{1,10000,30}
如何在表的列中存储拆分数组元素?
首先这可能吗,如果可能的话,有人可以解释一下,我们该怎么做?
像这样?
insert into test(idno, age, salary) select D[1], D[2], D[3] from (select '{1,10000,30}'::int[]) as A(D);
sql fiddle demo