Home > Database > Mysql Tutorial > body text

PostgreSQL对数组的遍历

WBOY
Release: 2016-06-07 16:19:20
Original
1397 people have browsed it

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]]]);

 

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!