Atitit postgre sql json使用法 目录 1.1.1. 插入数据 1 2. json数据的常见操作 1 1.1.1.插入数据 插入数据可以直接以json格式插入: insert
Atitit postgre sql json使用法
目录
插入数据可以直接以json格式插入:
insert into name_age values('{"id":1,"name":"小明", "age":18}')
在json里插入新的key值gender,如下:
SELECT info||'{"gender":"男"}'::jsonb from name_age where (info->>'id')::int4 = 1
Op | Postgre实现 | Demo |
Get JSON object field by key Get JSON array element | -> |
|
Get JSON object field as text | ->> |
|
Get JSON array element as text | ->> |
|
Get JSON object at specified path | #> json_extract_path |
|
Get JSON object at specified path as text | ##> |
|
exist as a top-level key
| ? |
|
these array strings exist as top-level keys是否存在系列key | ?| |
|
Do all of these array strings exist as top-level keys? | ?& |
|
Delete key/value | - |
|
Delete the field or element with specified path | #- |
|
|
|
|
Str_to json | to_json(anyelement) |
|
array_to_jso |
|
|
Rs row to json | row_to_json |
|
Arr to json | json_build_array |
|
| json_build_object |
|
Json_Str to json | json_object |
|
\ | json_each |
|
| json_each_text |
|
| json_object_keys |
|
Json to rs | json_populate_record |
|
| json_to_record |
|
【PostgreSQL】存取jsonb.html
PostgreSQL_ Documentation_ 9.6_ JSON Functions and Operators.html
相关文章
- MSSQL(Sql Server)数据特殊类型知识汇总
- logstash5.5.0同步sql server数据
- SQL中DateTime转换成Varchar样式
- 第三章用sql语句操作数据
- SQL SERVER导入数据到ORACLE的方法总结
- SQL server怎么查找某个时间段(多个时间段)的第一个值 或 最后一个值(这里举例查找每小时的第一个值)(Convert详细方法)...
- SQL server 导入数据 (excel导入到SQL server数据库)
- sql 查询数据长度
- 《转》SQL Server 2008 数据维护实务
- SQL server 2000 安装问题
- sql基础--怎样查询所有列数据
- spark sql简单示例
- 读书笔记--SQL必知必会08--使用函数处理数据
- SQL Server游标的使用
- WEB漏洞攻防 - SQL注入 - 高权限注入
- SQL -- 是否或推断线相交以在其内部的平面
- SQL控制台执行创建存储过程的脚本失败
- SQL的组合查询
- java-mybaits-00402-Mapper-动态sql-if、where、foreach、sql片段
- SQLFlow深度解析——含源码分析,商用存疑点:(1)RPC获取sql db数据,然后在引擎中计算AI部分(2)无监督算法(聚类、IForest)不支持,当前仅autoencoder
- win10中打开SQL Server配置管理器方法