Skip to content

Instantly share code, notes, and snippets.

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 tegansnyder/29cf0ec7b5ee182f9c5f to your computer and use it in GitHub Desktop.
Save tegansnyder/29cf0ec7b5ee182f9c5f to your computer and use it in GitHub Desktop.
JSON data type MySQL 5.7 Example Query
SELECT JSON_EXTRACT(config, '$.settings.lang_code') as lang_code FROM _jobs
@tegansnyder
Copy link
Author

SELECT category_id,
json_contains(`attributes`,'"Package Contents"', '$.tech') AS has_attribute
FROM portfolio_category_attributes_skus
WHERE portfolio_id = 126
HAVING has_attribute = 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment