Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 11, 2020 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/1a277436c55153132389b6844095f51c to your computer and use it in GitHub Desktop.
Save velotiotech/1a277436c55153132389b6844095f51c to your computer and use it in GitHub Desktop.
extracting properties
WITH dataset AS (
SELECT '{"name": "Susan Smith",
"org": "engineering",
"projects": [{"name":"project1", "completed":false},
{"name":"project2", "completed":true}]}'
AS blob
)
SELECT
json_extract(blob, '$.name') AS name,
json_extract(blob, '$.projects') AS projects
FROM dataset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment