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で複数の行を返すというエラーが発生し続けます。
誰も私がこの問題を解決するのを助けることができますか?
回答:
回答№1は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)