Я пытаюсь выяснить, как извлечь массив json в отдельные столбцы.Работа в MySQL 5.7.
данные, которые я хотел бы извлечь, содержатся в столбце «данные».Вот пример данных:
# id, member_id, event_type_id, leeds_event_id, source_event_id, staff_id, staff_name, date_start, date_end, data, created, deleted, id, source, name, created, deleted
6852184, 0034000000y3RSxAAM, 1, 1, , , Peter Nalli, , 2013-08-07 00:00:00, {"id": 1, "completed": 0, "member_id": "0034000000y3RSxAAM", "assigned_staff": "Peter Nalli", "date_completed": "2013-08-07"}, 2018-11-26 18:43:45, , 1, leeds_new.leenk_1o1s, 1 on 1s, 2018-07-24 11:14:27,
6852185, 0034000001rmsjRAAQ, 1, 2, , , Marcus Ceniceros, , 2016-11-22 00:00:00, {"id": 2, "completed": 0, "member_id": "0034000001rmsjRAAQ", "assigned_staff": "Marcus Ceniceros", "date_completed": "2016-11-22"}, 2018-11-26 18:43:45, , 1, leeds_new.leenk_1o1s, 1 on 1s, 2018-07-24 11:14:27,
6852186, 00340000010SqytAAC, 1, 3, , , Stephen de Man, , 2013-06-26 00:00:00, {"id": 3, "completed": 0, "member_id": "00340000010SqytAAC", "assigned_staff": "Stephen de Man", "date_completed": "2013-06-26"}, 2018-11-26 18:43:45, , 1, leeds_new.leenk_1o1s, 1 on 1s, 2018-07-24 11:14:27,
6852187, 00340000013znbgAAA, 1, 4, , , Peter Nalli, , 2013-05-23 00:00:00, {"id": 4, "completed": 0, "member_id": "00340000013znbgAAA", "assigned_staff": "Peter Nalli", "date_completed": "2013-05-23"}, 2018-11-26 18:43:45, , 1, leeds_new.leenk_1o1s, 1 on 1s, 2018-07-24 11:14:27,
6852188, 0034000000y3RgPAAU, 1, 5, , , Stephen de Man, , 2013-05-15 00:00:00, {"id": 5, "completed": 0, "member_id": "0034000000y3RgPAAU", "assigned_staff": "Stephen de Man", "date_completed": "2013-05-15"}, 2018-11-26 18:43:45, , 1, leeds_new.leenk_1o1s, 1 on 1s, 2018-07-24 11:14:27,
6852189, 0034000000y3SIRAA2, 1, 6, , , Stephen de Man, , 2013-03-06 00:00:00, {"id": 6, "completed": 0, "member_id": "0034000000y3SIRAA2", "assigned_staff": "Stephen de Man", "date_completed": "2013-03-06"}, 2018-11-26 18:43:45, , 1, leeds_new.leenk_1o1s, 1 on 1s, 2018-07-24 11:14:27,
6852190, 0034000000y3Q3DAAU, 1, 7, , , Lildella Douglas, , 2017-01-02 00:00:00, {"id": 7, "completed": 0, "member_id": "0034000000y3Q3DAAU", "assigned_staff": "Lildella Douglas", "date_completed": "2017-01-02"}, 2018-11-26 18:43:45, , 1, leeds_new.leenk_1o1s, 1 on 1s, 2018-07-24 11:14:27,
6852191, 0034000001Cr8MjAAJ, 1, 8, , , Thomas Beer, , 2015-06-26 00:00:00, {"id": 8, "completed": 0, "member_id": "0034000001Cr8MjAAJ", "assigned_staff": "Thomas Beer", "date_completed": "2015-06-26"}, 2018-11-26 18:43:45, , 1, leeds_new.leenk_1o1s, 1 on 1s, 2018-07-24 11:14:27,
6852192, 0034000000y3S98AAE, 1, 9, , , Peter Nalli, , 2015-03-18 00:00:00, {"id": 9, "completed": 0, "member_id": "0034000000y3S98AAE", "assigned_staff": "Peter Nalli", "date_completed": "2015-03-18"}, 2018-11-26 18:43:45, , 1, leeds_new.leenk_1o1s, 1 on 1s, 2018-07-24 11:14:27,
В качестве примера я хотел бы взять данные:
'{"id": 8, "completed": 0, "member_id": "0034000001Cr8MjAAJ", "assigned_staff": "Thomas Beer", "date_completed": "2015-06-26"}'
и извлечь в 5 отдельных новых столбцов.
Я пытался разобраться с этим с помощью json_extract (), но ничего не получилось.Я новичок в этом, и я немного растерялся.
Любая помощь будет принята с благодарностью.