I have a movie database with a searchfunction that have trouble making a query for.
My SQL that doesn't work is this:
SELECT DISTINCT TapeNr, Title, StartTime, EndTime
FROM Movies
INNER JOIN Actors
ON Movies.ID = Actors.MovieID
WHERE Actors.Actor = "Bruce Willis" AND Actors.Role = "Hans Gruber"
The problem with this SQL is that a movie is only selected if it has an actor named "Bruce Willis" with the role "Hans Gruber".
My intention is that if a movie has an actor named "Bruce Willis" and an other actor (or the same actor) has a role "Hans Gruber" the movie should be selected.
Does anyone have a solution?
My SQL that doesn't work is this:
SELECT DISTINCT TapeNr, Title, StartTime, EndTime
FROM Movies
INNER JOIN Actors
ON Movies.ID = Actors.MovieID
WHERE Actors.Actor = "Bruce Willis" AND Actors.Role = "Hans Gruber"
The problem with this SQL is that a movie is only selected if it has an actor named "Bruce Willis" with the role "Hans Gruber".
My intention is that if a movie has an actor named "Bruce Willis" and an other actor (or the same actor) has a role "Hans Gruber" the movie should be selected.
Does anyone have a solution?