标题:sql查询
只看楼主
fy069
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-10-27
 问题点数:0 回复次数:0 
sql查询

想把查询结果作为另一查询的表该如何做?

1、sele a,b, sum(c) as c into cursor t from d where e="2" group by a,b
从表D中汇总e='2',a,b相同的c 到临时表t中;
2、sele * from t where c<>0
从临时表t中选出c<>0的。

我分开执行可以,但我认为可以整合为一句。该如何办?

下列语句不行:
sele * from (sele a,b, sum(c) as c into cursor t from d where e="2" group by a,b)where c<>0


from后面的子查询该怎么写?

[此贴子已经被作者于2007-10-27 21:30:14编辑过]

搜索更多相关主题的帖子: cursor where 如何 
2007-10-27 21:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-181285-1-1.html




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

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