第一题给你做完了. select f.mname, f.语文, f.数学, f.英语, f.历史 from (select MName , 语文=sum(case when then score end), 数学=sum(case when then score end), 英语=sum(case when then score end), 历史=sum(case when then score end) from dbo.Member inner join dbo.score on dbo.Member.MID=dbo.score.MID group by MName ) f where f.数学 is not null and f.语文 is not null and f.英语 is not null and f.历史 is not null 第二题 select MName , 语文=sum(case when then score end), 数学=sum(case when then score end), 英语=sum(case when then score end), 历史=sum(case when then score end) from dbo.Member inner join dbo.score on dbo.Member.MID=dbo.score.MID where score