我已經創建了數據庫這樣的:複雜的SQL查詢多對多
我想選擇的人,電影的名字是同一個人充當「Oyuncu」和「Senarist」
請幫幫我。我寫了一個這樣的查詢;
select
MovieName,PersonName,RoleName
from
Movies,
MoviesPersonRole,
PersonRole,
Person,
Role
where
Movies.Id = MoviesPersonRole.MovieId
and
PersonRole.Id = MoviesPersonRole.PersonRoleId
and
PersonRole.RoleId = Role.Id
and
PersonRole.PersonId = Person.Id
,結果
MovieName PersonName RoleName
Pulp Fiction Mehmet Oyuncu
Pulp Fiction Mehmet Senarist
Matrix Aylin Oyuncu
LOTR Gökberk Oyuncu
LOTR Gökberk Senarist
Pulp Fiction Aylin Oyuncu
什麼是數據庫引擎? –
MSSQL服務器我的數據庫引擎 – MehmetF
你的意思是同一個演員在做Oyuncu和Senarist角色? – jarlh