I have Json data in one of my columns (student_data
) from table named data
.
The json data is as such:
[{"student_id":"1001","student_name":"patroclus","student_course":"medicine"},
{"student_id":"1002","student_name":"achilles","student_course":"acrhery"}]
I want to extract the student_name from this data, but I couldn't do it. I'm using phpmyadmin to access my database.
I tried using the following query:
SELECT JSON_EXTRACT(`student_data`, '$.student_name') AS student_name FROM `data`;
The error from MySQL says:
#1305 - FUNCTION data.JSON_EXTRACT does not exist