1.select stud.name from(select id from (select id,count(no) ccno from score group by id) where cno=4) a,stud where a.id=stud.id(+); 2.select * from csore where id='0003202';
楼主: 为什么不建一个SUBJECT表 SUBJECTID CHAR(10)..........课程号 SUBJECTNAME CHAR(40)..........课程名字 1、select a.name from student a,(select id from score group by id having count(*) = 4) b where a.id = b.id 2、没太看懂
我的第一个问题可不可以这样实现: select name from stud where id in (select id from score group by id where count(id)=4);假如现在要查找包含学号为‘0003202’所学课程的学生学号,我用以下的语句有些问题: select id from score where no in (select no from score where id='0003202'); 预想的结果应该是显示:0003201和0003201,但结果是0003201,0003202,0003203。 请问这是在什么地方有问题?谢谢!
1.select name from stud where id=(select id from score group by id having count(no)=4);2.不明白
2.select * from csore where id='0003202';
为什么不建一个SUBJECT表 SUBJECTID CHAR(10)..........课程号
SUBJECTNAME CHAR(40)..........课程名字
1、select a.name from student a,(select id from score group by id
having count(*) = 4) b
where a.id = b.id 2、没太看懂
select name from stud where id in
(select id from score group by id where count(id)=4);假如现在要查找包含学号为‘0003202’所学课程的学生学号,我用以下的语句有些问题:
select id from score where no in
(select no from score where id='0003202');
预想的结果应该是显示:0003201和0003201,但结果是0003201,0003202,0003203。
请问这是在什么地方有问题?谢谢!