Skip to content

Instantly share code, notes, and snippets.

@jaydson
Last active June 13, 2021 18:51
Show Gist options
  • Save jaydson/8c82e98f4c365cf83feec8f0fdd2a840 to your computer and use it in GitHub Desktop.
Save jaydson/8c82e98f4c365cf83feec8f0fdd2a840 to your computer and use it in GitHub Desktop.
--PostgreSQL 13
SELECT *
FROM shirts
WHERE details->'attributes'->>'color' = 'neon yellow'
AND details->'attributes'->>'size' = 'medium';
--PostgreSQL 14
SELECT *
FROM shirts
WHERE details['attributes']['color'] = '"neon yellow"'
AND details['attributes']['size'] = '"medium"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment