select distinct a.person.name, b.title,b.director.name
from movie_roles a, movie b
where a.person.name=
( select b.director.name
from movie b, movie_roles a
where b.director.name=a.person.name)
and b.movieID=a.movie.movieID;
我不断收到错误,说单个单子查询在Oracle中返回多行 任何人都可以帮我解决这个问题吗?
答案 0 :(得分:2)
它自我解释。在以下一行
where a.person.name= ( select b.director.name from movie b, movie_roles a where b.director.name=a.person.name)
您获得多个结果,因此您无法使用" ="。试试
where a.person.name IN( select b.director.name from movie b, movie_roles a where b.director.name=a.person.name)