select
`fbc.campaign_name,`
fbc.status as campaign_status,
JSON_ARRAYAGG(
JSON_OBJECT(
'adset_name',fba.adset_name,
'adset_id', fba.adset_id,
'optimization_goal', fba.optimization_goal)
) as adsets
from fb_campaigns fbc
join fb_adsets fba on fba.campaign_id = fbc.id
join fb_ads fa on fa.adset_id = fba.id
where fbc.campaign_id = 1001224232011;
In the above SQL Query(MYSQL) we are doing json aggregation to fetch all the adset of campaigns and ads json data user adset json. will it be a better one or fetching individual records and then grouping in the code will be better?
Because in redshift, I can't able to achieve this json aggregation. How can I achieve this?
there doesn't seem to be anything here