select distinct sid,sname
from Student where sid in(
select a.sid
from SC a,SC b
where a.sid=b.sid and a.cid='001' and b.cid='002' and a.score > b.score
);
Student表:
sc表:
Teacher表:
Course表:
select distinct sid,sname
from Student where sid in(
select a.sid
from SC a,SC b
where a.sid=b.sid and a.cid='001' and b.cid='002' and a.score > b.score
);
Student表:
sc表:
Teacher表:
Course表: