MySQL 5.7 JSON_EXTRACT: how to remove string quotes?
If you have MySQL 5.7.13 or later, you may use JSON_UNQUOTE()
instead of JSON_EXTRACT()
or ->>
instead of ->
. Example:
SELECT field->>"$.foo.barr" FROM table;
I can't comment on Alex Markov's answer because I don't have enough reputation. In my case using JSON_UNQUOTE instead of JSON_EXTRACT doesn't work, but I can get the result by wrapping the second inside the former, like this: JSON_UNQUOTE(JSON_EXTRACT(bla bla))