select *
from
CountryLanguage
where (Language, Country) IN (SELECT City.Name, Country.Code FROM ...)
Apparently, one will never get matches when they look for City.Name= CountryLanguage.Language.
On the other hand, in the subquery's join
SELECT City.Name, Country.Code FROM City, Country WHERE Country = Code and Code > 'LLL'
either table will have matches. Condition "City.Country=Country.Code" is the join intended by the dataset, each city lies within some existing country, and each country has some cities.
Indeed, let's take another look at the query:
select *
from
CountryLanguage
where (Language, Country) IN (SELECT City.Name, Country.Code FROM ...)
Apparently, one will never get matches when they look for City.Name= CountryLanguage .Language.
On the other hand, in the subquery's join
SELECT City.Name, Country.Code FROM City, Country WHERE Country = Code and Code > 'LLL'
either table will have matches. Condition "City.Country= Country. Code" is the join intended by the dataset, each city lies within some existing country, and each country has some cities.