select jsonb_agg(data)
from (
select jsonb_build_object(
'MobileOperator', MobileOperator,
'MobileQCellCore', MobileQCellCore,
'data', jsonb_agg(jsonb_build_object('UpdateTime', UpdateTime, 'Parvalue', Parvalue,'ProductState', ProductState) order by UpdateTime)) as data
from ods_tsc_product_info
where merchantid = 'xxxxxxxx' and productcategory = 'xxxxxxxx'
group by MobileOperator, MobileQCellCore
) temp
网友评论