I have two tables , on parent table (categories ) and child table (features).. I have this query
select c.* ,
(select GROUP_CONCAT(f.featuresId , f.featuresTitle )
from applika.features f
where f.categoriesId = c.categoriesId
group by categoriesId) as nestedData
from applika.categories c
PROBLEM : but in nestedData column my subquery in group_concat show the result inside quotes like this :
"nestedData": "featuresId:1featuresTitle:title1 ,featuresId:2featuresTitle:title2 ,featuresId:3featuresTitle:title3 ,featuresId:4featuresTitle:4"
REQUEST : but I don't want to show data in quotes , is there another way instead of GROUP_CONCAT or CONCAT to select my child data in ordinary array of objects like this for example :
[
...
"nestedData": [
{"featuresId":1 , "featuresTitle":"title1"},
{"featuresId":2 , "featuresTitle":"title2"} ,
{"featuresId":3 , "featuresTitle":"title3"},
{"featuresId":4 , "featuresTitle":title4"}
]
]
applika.features
is a view which uses some JSON function. Variant 2 is preferred.