关于mysql带有字符串行列转换问题

问题如下:
现有一个表,表里面的数据结构如下:
| user | question_id | score | | name|
| S001 | 1 | 1.2 | | xiao1|
| S001 | 2 | 2.3 | | xiao1|
| S001 | 3 | 2.5 | | xiao1|
| S001 | 4 | 4.2 | | xiao1|
| S001 | 5 | 4.2 | | xiao1|
| S002 | 1 | 3.4 | | xiao2|
| S002 | 2 | 4.5 | | xiao2|
| S002 | 3 | 2.6 | | xiao2|
| S002 | 4 | 3.8 | | xiao2|
| S002 | 5 | 4.2 | | xiao2|
注意:表里面的name列的数据类型为字符串,score也是字符类型,question_id为整型。
先要把数据行列转换为如下格式:
+--------+-------+-------+-------+-------+-------+------+
| 用户名 | 问题1 | 问题2 | 问题3 | 问题4 | 问题5 | name
| S001 | 1.2 | 2.3 | 2.5 | 4.2 | 4.2 | xiao1 |
| S002 | 3.4 | 4.5 | 2.6 | 3.8 | 4.2 | xiao2 |
里面的数据格式包含有字母的字符串类型,例如name列就是。
现在如果要转为上面的格式,请问各位将如何处理,最后能够给出方法和例子。

select 用户名,sum(问题1),sum(问题2),sum(问题3),sum(问题4),sum(问题5),name from (select user as '用户名', (case question_id when 1 then score else null end) as '问题1', (case question_id when 2 then score else null end) as '问题2', (case question_id when 3 then score else null end) as '问题3', (case question_id when 4 then score else null end) as '问题4', (case question_id when 5 then score else null end) as '问题5', name from test ) as alia group by 用户名;