Skip to content

Instantly share code, notes, and snippets.

@wouldhide
Created October 7, 2017 18:37
Show Gist options
  • Save wouldhide/dcf94bbda63723d4c2162ebde5528c45 to your computer and use it in GitHub Desktop.
Save wouldhide/dcf94bbda63723d4c2162ebde5528c45 to your computer and use it in GitHub Desktop.
Search in MySQL JSON field
# select `name` from tags;
# {"en": "Lorem Ipsum", "hu": "Lorem Ispsum"}
select JSON_EXTRACT(`name`, "$.en") as `name`
from tags
where lower(JSON_EXTRACT(`name`, "$.en")) like "%ipsum%";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment