PostgreSQL中的数组与Any

前端之家收集整理的这篇文章主要介绍了PostgreSQL中的数组与Any前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

建立表:

CREATE TABLE sal_emp (
name            text,pay_by_quarter  integer[],schedule        text[][]
);

插入数据:

INSERT INTO sal_emp
  VALUES ('Bill',ARRAY[10000,11000,9000,13000],0); line-height:1.5!important">['meeting','lunch'],'training','presentation']]);

Carol20000,25000,25000['breakfast','consulting''meeting',0); line-height:1.5!important">Frank]]);

查看:

pgsql=# SELECT * FROM sal_emp;
 name  |      pay_by_quarter       |                 schedule                  
-------+---------------------------+-------------------------------------------
 Bill  | {10000,11000,0); line-height:1.5!important">9000,0); line-height:1.5!important">13000}  | {{meeting,lunch},{training,presentation}}
 Carol 20000,0); line-height:1.5!important">25000,0); line-height:1.5!important">25000} | {{breakfast,consulting},{meeting,lunch}}
 Frank 10000} 3 rows)

pgsql=# 

猜你在找的Postgre SQL相关文章