标签:
SELECT MName, SUM(CASE B.FName WHEN ‘语文‘ THEN A.Score END) AS 语文, SUM(CASE B.FName WHEN ‘数学‘ THEN A.Score END) AS 数学, SUM(CASE B.FName WHEN ‘英语‘ THEN A.Score END) AS 英语, SUM(CASE B.FName WHEN ‘历史‘ THEN A.Score END) AS 历史 FROM dbo.Member LEFT JOIN dbo.Score A ON A.MID = Member.MID LEFT JOIN F B ON B.FID = A.FID GROUP BY MName
标签:
原文地址:http://www.cnblogs.com/linhongquan/p/5517398.html