| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 522 人关注过本帖
标题:请高手帮忙看几个程序
只看楼主 加入收藏
anxiaonong
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2005-8-20
收藏
 问题点数:0 回复次数:0 
请高手帮忙看几个程序
程序要求是查询出能满足世界GDP 总量一半的必要的人口数量,但是里面很多select from(select from 结构,请问怎么理解?另外 t1,t2,t3,t4代表什么?

程序如下:
select sum(population) from
(select t1.name, t1.efficiency,t1.population,t1.gdp,(select sum(gdp) from
                                                                    (select name,gdp/c2.population as efficiency,population,gdp
                                                                     from country c2, economy e2
                                                                     where c2.code = e2.country and e2.gdp is not null
                                                                     order by efficiency desc) t2
                                                   
where t2.efficiency >= t1.efficiency) as total
from
    (select name,gdp/c1.population as efficiency,population,gdp
     from country c1, economy e1
     where c1.code = e1.country and e1.gdp is not null
     order by efficiency desc)  t1)t3,
(select sum(gdp)/2 as gdp_50 from economy) t4
where total <= gdp_50
搜索更多相关主题的帖子: 查询 世界 efficiency country 
2009-07-25 22:17
快速回复:请高手帮忙看几个程序
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.038140 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved