Saturday, 17 August 2013

SQLzoo | JOIN operation

SQLzoo | JOIN operation

I'm trying to solve question 13 of JOIN tutorial in SQLzoo
(http://sqlzoo.net/wiki/More_JOIN_operations)
The question ask to list the film title and the leading actor for all of
the films 'Julie Andrews' played in.
I've produced the following script, but somewhere is wrong.
SELECT title, actor.name FROM
movie JOIN casting ON movie.id=movieid
JOIN actor ON actor.id=actorid
WHERE ord=1
AND title = ALL
(SELECT title FROM
movie JOIN casting ON movie.id=movieid
JOIN actor ON actor.id=actorid
WHERE actor.name='Julie Andrews')

No comments:

Post a Comment