agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: postgres json: How to query map keys to get children
Date: Sat, 23 Aug 2014 13:18:52 -0700 (PDT)
Message-ID: <1408825132229-5816009.post@n5.nabble.com> (raw)
In-Reply-To: <BAY178-W513E01F52C8A4324953A74F8D10@phx.gbl>
References: <BAY178-W513E01F52C8A4324953A74F8D10@phx.gbl>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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-tp581600...
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (3+ messages)  latest in thread

Message-ID: <1408825132229-5816009.post@n5.nabble.com>
Permalink:  ../1408825132229-5816009.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1408825132229-5816009.post@n5.nabble.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: david.g.johnston@gmail.com
  Subject: Re: postgres json: How to query map keys to get children
  In-Reply-To: <1408825132229-5816009.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox