【发布时间】:2020-06-16 20:32:40
【问题描述】:
我有两张表国家(id,国家)和城市(id,城市,countryId)我想选择国家并显示有多少城市作为位置。
我试过了:
SELECT countryid, COUNT(*) AS locations
FROM Cities
GROUP BY countryid
但它显示的是 countryid 而不是 country
【问题讨论】:
-
加入 Country Table 并从 Country Table 中获取 Country 值。
标签: sql