| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
共有 79 人关注过本帖
标题:统计结果不再放到 B6里怎么办
只看楼主 加入收藏
yd1954
Rank: 2
来 自:辽宁沈阳
等 级:论坛游民
帖 子:161
专家分:21
注 册:2016-7-1
结帖率:100%
收藏
 问题点数:0 回复次数:2 
统计结果不再放到 B6里怎么办
schtg 老师你好。你对我在6月11日的帮助请求给了下面的代码。
现在我想将这段代码的统计结果放到B5的h120g,h120c字段里,不放到B6里。应该怎么改?我不会,请老师帮助。
B5被我改来改去,其中的字段与6月的不同。

select distinct h12_0 as hz1g,min(xh) as zxh,000000 as hz1c from b5 group by h12_0 order by zxh into cursor t1 readwrite
select h12_0,count(*) as zcs from b5 group by h12_0 into cursor t2
update t1 set t1.h120c = t2.zcs from t1,t2 where t1.h120g = t2.hz_1b
select h120g,h120c from t1 where h120c > 0 order by zxh into table B6

b5.zip (53.33 KB)
搜索更多相关主题的帖子: into 结果 from select 统计 
2025-07-20 21:44
schtg
Rank: 13Rank: 13Rank: 13Rank: 13
来 自:Usa
等 级:贵宾
威 望:67
帖 子:2156
专家分:4682
注 册:2012-2-29
收藏
得分:0 
直接在后面加上一些判断代码和赋值代码即可,请试一试哈。
程序代码:
select distinct h12_0 as hz1g,min(xh) as zxh,000000 as hz1c from b5 group by h12_0 order by zxh into cursor t1 readwrite
select h12_0,count(*) as zcs from b5 group by h12_0 into cursor t2
update t1 set t1.h120c = t2.zcs from t1,t2 where t1.h120g = t2.h12_0
select h120g,h120c from t1 where h120c > 0 order by zxh into table B6

SELECT B5
IF Fsize("h120c") > 0
else 
   alter table B5 add h120c n(7,0)
endif
update B5 set B5.h120c = B6.hz1c from B5,B6 where B5.hz_1b = B6.hz1g
2025-07-21 07:10
yd1954
Rank: 2
来 自:辽宁沈阳
等 级:论坛游民
帖 子:161
专家分:21
注 册:2016-7-1
收藏
得分:0 
回复 2楼 schtg
非常感谢老师的帮助。程序运行了几次也没行。不知道什么原因。先把账结了。隔一段时间再说。
7 天前 16:21
快速回复:统计结果不再放到 B6里怎么办
数据加载中...
 
   



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

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.033868 second(s), 10 queries.
Copyright©2004-2025, BC-CN.NET, All Rights Reserved