You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »


Extracting "First Level" Data Fields 

In the code below, 'item_status' is a first level jsonb field. In the blob, the main field 'status' has only one subfield (one possible value).
'Requester_last_name' and 'requester_first_name' are both second-level fields, because the main field 'personal' has many sub-fields, including first_name, middle_name, last_name, id, etc.



SELECT
folio_users.users__.id,
jsonb_extract_path_text (folio_users.users__ .jsonb, 'status') AS item_status,
FROM
folio_users.users__



SELECT
folio_users.users__.id,
jsonb_extract_path_text (folio_users.users__ .jsonb, 'status') AS item_status,
jsonb_extract_path_text (folio_users.users__ .jsonb, 'personal', 'lastName') AS requestor_last_name,
jsonb_extract_path_text (folio_users.users__ .jsonb, 'personal', 'firstName') AS requestor_first_name
FROM
folio_users.users__

  • No labels