>SELECT genus, species, continent ; > FROM Species P INNER JOIN Site S ON P.Pkey = S.fkey AND S.continent IN ('Africa','Asia') ; > WHERE EXISTS (SELECT * FROM Site WHERE fKey = P.Key AND Continent = 'Asia') AND ; > EXISTS (SELECT * FROM Site WHERE fKey = P.Key AND Continent = 'Africa') ; > ORDER BY 1,2 >>------------
>SELECT genus, species, continent ; > FROM Species P JOIN Site S ON P.Pkey = S.fkey AND S.continent IN (ContinentList) ; > WHERE P.Pkey IN (SELECT fkey FROM Site WHERE Continent IN (ContinentList) GROUP BY 1 HAVING COUNT(*)=ContinentListCount) ; > ORDER BY 1,2 >Not bad... However, we only have 7 continents ;-) Seriously, though this indeed is a good example there are some difference to note: