MySQL嵌套查詢語句統(tǒng)計(jì)每個(gè)省的人口最多的與最少的城市
SELECT District,NAME,Population FROM city WHERE Population IN (SELECT MIN(Population) FROM city
WHERE city.CountryCode='CHN'
GROUP BY city.District)
UNION
SELECT District,NAME,Population FROM city WHERE Population IN (SELECT MAX(Population) FROM city
WHERE city.CountryCode='CHN'
GROUP BY city.District)