请建议一个 sql 查询来获取
“如果学生在多个科目中得分相同,则学生和相应科目的学生名单相同”
例如。
Student Subject Score
John Science 80
John Maths 80
John English 80
John French 80
Peter Science 85
Peter Maths 70
Peter English 70
Peter French 70
Mathews French 70
Expected Result :
John Science
John Maths
John English
John French
Peter Maths
Peter English
Peter French
试过了——
select person , subject where person in
( select person , score , count(score) group by person , score having count(score) > 1 )
但是在这个“彼得科学”中出现了,这不是必需的。
请协助。
谢谢