SELECT S.NAME, sum(decode(S.COURSE,'语文',S.SCORE,0))"语文", sum(decode(S.COURSE,'数学',S.SCORE,0))"数学", sum(decode(S.COURSE,'英语',S.SCORE,0))"英语" FROM S_SCORE S GROUP BY S.NAME;
SELECT S.NAME, sum(decode(S.COURSE,'语文',S.SCORE,0))"语文", sum(decode(S.COURSE,'数学',S.SCORE,0))"数学", sum(decode(S.COURSE,'英语',S.SCORE,0))"英语" FROM S_SCORE S GROUP BY S.NAME;