阅读背景:

如何从数据库中使用SQL查询获取国家和城市的数量?

来源:互联网 

By running this query:

通过运行此查询:

select 
    c.name, count(s.name) as statecount,  
    sum(count(ci.name)) OVER() AS citycount 
from 
    countries c, states s, cities ci
where 
    ci.state_id = s.id 
    and s.country_id = c.id 
group by 
    s.name
select 
   



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: