0

所以,我有这个通过自然连接组合两个表的内联视图。我有一些条件可以使视图更易于管理。

Select * from student
natural join course
where student.stuNo = '838637'
and course.crsno = 'CS201'

现在,我想从这个视图与另一个表进行左外连接。我收到一条错误消息,对于我的生活,我无法弄清楚如何解决它。这是我的最后一个片段:

Select * from score2
left outer join (
Select * from student
natural join course
where student.stuNo = '838637'
and course.crsno = 'CS201') as Test1
on Test1.stuno = score2.studentNO

错误消息说我缺少一个关键字,但我不知道在哪里。有什么帮助吗?

4

1 回答 1

1

关键字AS不应该在那里:

Select * from score2
left outer join (
Select * from student
natural join course
where student.stuNo = '838637'
and course.crsno = 'CS201') Test1
on (Test1.stuno = score2.studentNO)
于 2013-10-29T18:20:50.407 回答