主题:新手求救(不知错在哪?)
(2) 检索至少选修了课程号为c01和c02的学生学号
我编写的语句如下:
select distinct Sno
from Reports
where (Cno='C01' and Cno='C02')
intersect
select distinct Sno
from Reports
where (Cno='C01' and Cno='C02')
执行时报错说明如下:
Server: Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'intersect'.
所建数据库ST中有三张表(Students,Reports,Courses)如下:
我编写的语句如下:
select distinct Sno
from Reports
where (Cno='C01' and Cno='C02')
intersect
select distinct Sno
from Reports
where (Cno='C01' and Cno='C02')
执行时报错说明如下:
Server: Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'intersect'.
所建数据库ST中有三张表(Students,Reports,Courses)如下: