Skip to content

Instantly share code, notes, and snippets.

@maxout
Last active February 18, 2022 16:34
Show Gist options
  • Save maxout/bd35754fa923bc8c00c11e05827ce3de to your computer and use it in GitHub Desktop.
Save maxout/bd35754fa923bc8c00c11e05827ce3de to your computer and use it in GitHub Desktop.
SELECT from JSON String
SELECT p.id,p.manufacturer_number ,pt.product_id,JSON_EXTRACT(custom_fields, '$.custom_rim_details_number')
FROM product_translation pt
INNER JOIN product p ON pt.product_id = p.id
WHERE JSON_EXTRACT(custom_fields, '$.custom_rim_details_number') IS NOT NULL
AND JSON_EXTRACT(custom_fields, '$.custom_rim_details_number') != 'null';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment