增删改查
最后更新于:2022-04-02 03:57:56
[TOC]
## 增删改查
实例为对数组的操作
```
// 创建表
CREATE TABLE "sal_emp" (
"name" text ,
"pay_by_quarter" int[],
"schedule" text[][]
)
// 插入
insert into sal_emp VALUES('a','{1,2,3}','{{"a","b","c"},{"d","e","f"}}')
// 更新,注意: postgresql 数组索引从1开始
update sal_emp set pay_by_quarter[1]=123
// 获取
select pay_by_quarter from sal_emp
// {123,2,3}
select pay_by_quarter[1] from sal_emp
// 123
```
';