The purpose of my request is to return the name of the country and its head of state if headofstate has a name starting with A, and in the capital of the country more than 100,000 people using the sub-request.
Here is my request:
SELECT country.name as country, (SELECT country.headofstate from country where country.headofstate like 'A%') from country, city where city.population > 100000;
I tried changing it by putting in a where clause, etc. I do not receive subqueries. I just return errors, for example, "subquery returns more than one row", etc. If someone can help me on how to order it and explain why this should be a certain way, that would be great.
sql nested
Zax
source share