Home  >  Article  >  Database  >  PostgreSQL对数组的遍历

PostgreSQL对数组的遍历

WBOY
WBOYOriginal
2016-06-07 16:19:201398browse

create table test_array(id serial primary key, str1 int[][][]); 插入两条测试数据。 insert into test_array values (1,array[[[1,2],[3,4],[5,6]],[[20,30],[40,50],[70,100]]]); insert into test_array values (2,array[[[100,200],[300,400],[500,60

create table test_array(id serial primary key, str1 int[][][]);

 

 

插入两条测试数据。

insert into test_array values (1,array[[[1,2],[3,4],[5,6]],[[20,30],[40,50],[70,100]]]);

insert into test_array values (2,array[[[100,200],[300,400],[500,600]],[[2000,3000],[4000,5000],[7000,10000]]]);

 

为了能直观的看到结果集,我们得把数组的值换成普通的类型拿出来, 有以下几种方法。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn