First of all, I am using MySQL v5.7 .
Now, here is the problem... This following example works (provided by Official MySQL website) :
SELECT JSON_EXTRACT('{"id": 14, "name": "Aztalan"}', '$.name');
And it returns "Aztalan"
.
But this one doesn't work:
SELECT JSON_EXTRACT('{"user.id": 14, "user.name": "Aztalan"}', '$.user.name');
How can I get the "user.name" json property name with json_extract function?
Working way is to quote the key:
SELECT JSON_EXTRACT('{"user.name": "Aztalan"}', '$."user.name"');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With