SELECT Country.NAME, COUNT(City.NAME) as Number_of_cities
FROM City
JOIN Country ON City.COUNTRY = Country.CODE
WHERE City.LONGITUDE IS NULL AND City.LATITUDE IS NULL
GROUP BY Country.NAME, City.COUNTRY;
就像现在的代码一样,没有显示那些只有长宽值城市的国家。我该如何更改代码,以便所有城市都有长距离和纬度值的国家将0显示为coun?
1条答案
按热度按时间xhv8bpkk1#
你想要一个
left join
,在on
条款: