You should just IFNULL
the column that can be NULL
;
SELECT userId, GROUP_CONCAT(CONCAT(questionId, '=',
IFNULL(selectionId, 'NULL')))
FROM selection
GROUP BY userId;
Demo here.
You should just IFNULL
the column that can be NULL
;
SELECT userId, GROUP_CONCAT(CONCAT(questionId, '=',
IFNULL(selectionId, 'NULL')))
FROM selection
GROUP BY userId;
Demo here.