Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

MYSQL JSON OBJECT

SELECT 
o_id, 
CONCAT(
    '{', 
    GROUP_CONCAT(
        CONCAT(
            '"',
            `attribute`,
            '":"',
            `value`,
            '"'
            )
        ),
    '}'
    ) json 
FROM t3 
GROUP BY o_id
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #MYSQL #JSON #OBJECT
ADD COMMENT
Topic
Name
9+7 =