首页 新闻 会员 周边 捐助

MYSQL - 查询不同课程成绩相同的学生的学生编号、课程编号、学生成绩

0
悬赏园豆:10 [待解决问题]

飞翔的石牌人的主页 飞翔的石牌人 | 初学一级 | 园豆:37
提问于:2021-01-25 15:45

select * from student_course
where sid in (select sid from student_course group by sid,score having count() > 1)
and score in (select scorefrom student_course group by sid,score having count(
) > 1)

代码中透露着杀气 3年前
< >
分享
所有回答(2)
0

select * from student_course
where sid in (select sid from student_course group by sid,score having count(*) > 1)
and score in (select scorefrom student_course group by sid,score having count(*) > 1)

代码中透露着杀气 | 园豆:221 (菜鸟二级) | 2021-01-25 16:38
0

select t2.id,t2.cid,t2.score from kmcgc.student_course t2 , (
select t1.cid,t1.score from kmcgc.student_course t1
group by t1.cid,t1.score having count(t1.score)>1) t3
where t2.cid=t3.cid and t2.score = t3.score

慢半拍v | 园豆:202 (菜鸟二级) | 2021-01-25 16:51

不同课程成绩相同

A.一个学生有两个相同成绩,并且课程不同

B.一个课程有两个相同的成绩

A和B哪个才是正确的解释呢

支持(0) 反对(0) 代码中透露着杀气 | 园豆:221 (菜鸟二级) | 2021-01-25 17:00

@代码中透露着杀气: B

支持(0) 反对(0) 慢半拍v | 园豆:202 (菜鸟二级) | 2021-01-25 17:04
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册