Actually that's those are correlated subqueries; subqueries, yes, but not correlated.
The queries will be executed from the bottom up. That is, this will be done first:
( SELECT CompactDiscID FROM CompactDiscs WHERE CDTitle = 'Past Light' )
Then this:
( SELECT ArtistID FROM ArtistCDs WHERE CompactDiscID IN ...)
and finally:
SELECT ArtistName FROM Artists
WHERE ArtistID IN ...
Main Topics
Browse All Topics





by: imrancsPosted on 2004-06-16 at 07:50:27ID: 11325051
SELECT ArtistName FROM Artists A
INNER JOIN ArtistCDs Ac ON A.ArtistID = Ac.ArtistID
INNER JOIN CompactDiscs Cd ON Ac.CompactDiscID = Cd.CompactDiscID
Imran