Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Postgresql数据库中拆分数组并将其存储到表的相关列中_Sql_Arrays_Postgresql_Postgresql 9.1_Phppgadmin - Fatal编程技术网

如何在Postgresql数据库中拆分数组并将其存储到表的相关列中

如何在Postgresql数据库中拆分数组并将其存储到表的相关列中,sql,arrays,postgresql,postgresql-9.1,phppgadmin,Sql,Arrays,Postgresql,Postgresql 9.1,Phppgadmin,我将{idno,age,SALLAY}元素数组插入为{110000,30} 在PostgreSQL数据库中,我需要拆分并存储到表的相关列中 如何在表的列中存储拆分的数组元素 首先,这可能吗?如果可能的话,有人能解释一下,我们怎么做吗?像这样 insert into test(idno, age, salary) select D[1], D[2], D[3] from (select '{1,10000,30}'::int[]) as A(D); 像这样吗 insert into test(i

我将{idno,age,SALLAY}元素数组插入为
{110000,30}
在PostgreSQL数据库中,我需要拆分并存储到表的相关列中

如何在表的列中存储拆分的数组元素

首先,这可能吗?如果可能的话,有人能解释一下,我们怎么做吗?

像这样

insert into test(idno, age, salary)
select D[1], D[2], D[3]
from (select '{1,10000,30}'::int[]) as A(D);
像这样吗

insert into test(idno, age, salary)
select D[1], D[2], D[3]
from (select '{1,10000,30}'::int[]) as A(D);

因此,您在PostgreSQL中有一个包含这三个数字的数组,并且希望
更新。。。在某个表上设置idno=1,年龄=10000,薪水=30
?谢谢,我正在某个表的相关列中插入元素数组。这三个数字插入到相关列中。因此,您在PostgreSQL中有一个包含这三个数字的数组,您想
更新。。。在某个表上设置idno=1、年龄=10000、薪水=30
?谢谢,我正在某个表的相关列中插入元素数组。这三个数字插入到它们的相关列中。