Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/238.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用postgres提取Json_Php_Json_Postgresql_Json Extract - Fatal编程技术网

Php 使用postgres提取Json

Php 使用postgres提取Json,php,json,postgresql,json-extract,Php,Json,Postgresql,Json Extract,我有一个json { 计时器:{ 19272: { 资产识别号:9354, 原始总时间:5, 原始警告时间:空 } }, SEBKeys:[], 分数映射:[] } 我需要使用Postgres从这个json中提取“原始的总时间”值 有人能帮忙吗?如果您的JSON结构是固定的,那么您可以使用以下查询 select json_->'timer'->'19272'->>'original_total_time' from test 如果您使用的是PHP,您可以使用。我可以在查

我有一个json

{ 计时器:{ 19272: { 资产识别号:9354, 原始总时间:5, 原始警告时间:空 } }, SEBKeys:[], 分数映射:[] } 我需要使用Postgres从这个json中提取“原始的总时间”值


有人能帮忙吗?

如果您的JSON结构是固定的,那么您可以使用以下查询

select json_->'timer'->'19272'->>'original_total_time' from test

如果您使用的是PHP,您可以使用。我可以在查询本身中找到任何方法吗?您的JSON结构是fix还是dynamicI得到了解决方案选择*,requests.request->“notes”->JSON\u object\u keysrequests.request->“notes”::JSON->“message”作为来自请求的消息