Skip to content

Instantly share code, notes, and snippets.

@tranphuoctien
Created December 14, 2020 10:43
Show Gist options
  • Save tranphuoctien/aed1540ec56b5f03369536514244575b to your computer and use it in GitHub Desktop.
Save tranphuoctien/aed1540ec56b5f03369536514244575b to your computer and use it in GitHub Desktop.
Query JSON in mysql data array[]
# Data in column alert
|alert
'[{"days": 2, "past": true, "time": 1607299200, "hours": 0, "weeks": 0, "minutes": 0, "seconds": 0}, "description": "Reminder"}]';
SELECT *
FROM
WHERE alert->'$[*].trigger.time' <= JSON_ARRAY(1607731200);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment