java吧 关注:1,259,581贴子:12,754,521
  • 0回复贴,共1

求高性能的sql语句,学生表,成绩表,查询既参加A又参加B考试语句

取消只看楼主收藏回复

学生表 student (id,name)
成绩表 score (id,student_id,subject,grade);
求查询既参加A又参加B考试的学生。
我有一种土办法,但是不知道高不高效,
select * from student where id in (select * from score where subject = "A") and id
in (select * from score where subject = "B");


1楼2016-02-13 23:03回复