答案 0 :(得分:0)
如果实际上只有3个问题,并假设该表名为Student,则可以执行以下操作:
select studentid AS Student,
(select Questionpoints from Student where studentid = a.studentid and Questionid = 8) AS Qn1,
(select Questionpoints from Student where studentid = a.studentid and Questionid = 9) AS Qn2,
(select Questionpoints from Student where studentid = a.studentid and Questionid = 10) AS Qn3
from Student as a
group by studentid;