mysql中json数据的拼接方式 – lxyy运营团队 – 博客园

来源: mysql中json数据的拼接方式 - lxyy运营团队 - 博客园
[code]
SELECT
CONCAT('[',
GROUP_CONCAT(
CONCAT('{"id":"',STRUCTURE_ID,'"'),',',
CONCAT('"pId":"',parent_id,'"'),
CONCAT(',"name":"',STRUCTURE_NAME),'"',
CONCAT(',"structure_code":"',structure_code),'"}')

,']')
AS json FROM t_resource_structure where STRUCTURE_ID BETWEEN 1110 and 1111
[/code]