0

I have a column in MYSQL table from which I want to get object's first value, and I don't know what is the kay name. Values are like:

{"5":"ABC"} 
{"8":"CDE"}

I have tried JSON_EXTRACT, JSON_KEYS but nothing work for me.

Anand agrawal
  • 492
  • 6
  • 25

1 Answers1

3

Below query worked for me:

SELECT json_extract(json_data,'$[0].*') from table

For detailed documentation, go through JSON_EXTRACT once.

Ankit Jindal
  • 3,672
  • 3
  • 25
  • 37