Re: postgres json: How to query map keys to get children - Mailing list pgsql-sql

From David G Johnston
Subject Re: postgres json: How to query map keys to get children
Date
Msg-id 1408825132229-5816009.post@n5.nabble.com
Whole thread Raw
In response to postgres json: How to query map keys to get children  (Hector Menchaca <hm34306@hotmail.com>)
Responses Re: postgres json: How to query map keys to get children  (Hector Menchaca <hm34306@hotmail.com>)
List pgsql-sql
Hector Menchaca wrote
>  json_array_elements(ResourceDocument->'Skill'->*)

NOT TESTED (or complete)

SELECT skill_type.value->'Name'
FROM (
SELECT * FROM json_each(rd->'Skill')
) skill_type

Because you want columns for Name, etc, you must list those explicitly
instead of using json_each over those.

David J.



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/postgres-json-How-to-query-map-keys-to-get-children-tp5816001p5816009.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



pgsql-sql by date:

Previous
From: Hector Menchaca
Date:
Subject: postgres json: How to query map keys to get children
Next
From: Hector Menchaca
Date:
Subject: Re: postgres json: How to query map keys to get children