JSON array using mySQL 5.7 json_object, group_concat and concat

preview_player
Показать описание
Create json array using mysql functions json_object, group_concat and concat.
Рекомендации по теме
Комментарии
Автор

This is good use of mysql, I used to get a regular resultSet and iterate over it to create json object for REST response in java.
Thanks !!!

PiniCheyni
Автор

1. group_concat itself have limit on the length, so you can get wrong data output with cuted out data!
2. you will get json as string but not JSON as object!! To get an object you need to wrap the last output to one more JSON_OBJECT

ClassoduaClassodua
Автор

Is it possible to put limit into group_concat? I mean, if i want to limited it. example I want only person 1, person 2 and 3 in group_concat...

adamvitak
join shbcf.ru