SELECT t1.id, json_agg((SELECT * FROM t2 WHERE t2.id = t1.id)) FROM t1;
SELECT
t1.id,
CONCAT('[{',
GROUP_CONCAT(
(SELECT CONCAT('field1: ', t2.field1, ', field2: ' t2.field2) FROM t2 WHERE t2.id = t1.id)
SEPARATOR ' }, { '
), '}]'
FROM t1 GROUP BY t1.id