Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WITH countries_with_cities AS (
- SELECT countries.name country, COUNT(cities) count_of_cities_25
- FROM countries
- INNER JOIN cities ON cities.country_id = countries.id
- GROUP BY countries.name
- ), SELECT COUNT(people) count_of_people_30
- FROM people
- INNER JOIN countries_with_cities ON ? = people.city_id
- GROUP BY people.name;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement