Skip to content
Advertisement

How to parse a json object – mysql

I have a json object like this:

I want to get free_day value from key object is 2. (at this here is 5).

Advertisement

Answer

Using JSON_EXTRACT:

Note that because you are using numbers as JSON keys, they need to be escaped in double quotes.

Demo

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement