1SET @sql = NULL;
2SELECT
3 GROUP_CONCAT(DISTINCT
4 CONCAT(
5 'max(case when field_key = ''',
6 field_key,
7 ''' then field_value end) ',
8 field_key
9 )
10 ) INTO @sql
11FROM
12 Meeting;
13SET @sql = CONCAT('SELECT Meeting_id, ', @sql, '
14 FROM Meeting
15 GROUP BY Meeting_id');
16
17PREPARE stmt FROM @sql;
18EXECUTE stmt;
19DEALLOCATE PREPARE stmt;
20
21