代码如下(9.0版本):
sele *,recn() vvn from data into curs tmp readw
sele tmp.*, (sele sum(1) from tmp k where k.行业=tmp.行业 .and.k.vvn<=tmp.vvn) nn from tmp into curs tmp1 readw
sele tmp1.*, (sele sum(产值频率) from tmp1 k where k.行业=tmp1.行业 .and.k.nn<=tmp1.nn) as 累加 from tmp1 into curs tmp
sele tmp.nn 业内排位, tmp.代码,tmp.行业,tmp.产值,tmp.产值频率,tmp.累加 from tmp
inne join;
( sele 行业,cnt(*) tj from tmp where 累加<0.5 grou by 行业 ) k on tmp.行业=k.行业.and.tmp.nn<=k.tj+1
测试结果图示:
图片附件: 游客没有浏览图片的权限,请
登录 或
注册
[
本帖最后由 茵梦湖 于 2010-3-25 01:29 编辑 ]