行转化为列
2014-12-02 11:52 愿得一人心 阅读(153) 评论(0) 编辑 收藏 举报SELECT id, (SELECT Score FROM Table_1 WHERE KeMu='数学' AND id=a.id)as 数学, (SELECT Score FROM Table_1 WHERE KeMu='语文' AND id=a.id)AS 语文, (SELECT Score FROM Table_1 WHERE KeMu='英语' AND id=a.id)AS 英语 FROM Table_1 a GROUP BY a.id