PostgreSQL中的数组与Any

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

建立表:

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

插入数据:

@H_301_4@INSERT @H_301_4@INTO sal_emp
  @H_301_4@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=# @H_301_4@SELECT * @H_301_4@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相关文章