如何取得select语句结果集中的结果行数?

Nwing 2003-01-28 02:55:15
pb中,使用此语句:
Select aa From table into :aa1;
如何知道此结果集中的记录条数?
在sql server中
是select aa from table compute count(*)

在pb中完全不能用。
为什么
...全文
132 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Nwing 2003-01-29
  • 打赏
  • 举报
回复
是这样的
select a,count(*) from table group by a;
count(*) 是本分组的记录条数
我要的是此语句结果的记录条数。
liuyxit 2003-01-29
  • 打赏
  • 举报
回复
除了上述方法外
可以用数据窗口的计算域来实现
laofei2000 2003-01-29
  • 打赏
  • 举报
回复
select count(*) as num_count,sum(column) as num_sum from table

是这样吗?
Nwing 2003-01-29
  • 打赏
  • 举报
回复
我是意思是得到查询结果集的同时得到结果集的另一些统计
比如结果集的记录条数,结果集中某字段的数据累加,平均值等。
请多指教
ice119103 2003-01-28
  • 打赏
  • 举报
回复
select count(aa)
into :aal
from table;
Nwing 2003-01-28
  • 打赏
  • 举报
回复
这句话不行
根本不能编译通过。
wanghongcc 2003-01-28
  • 打赏
  • 举报
回复
select count(*) into :aal from table;

754

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧