100分求助简单问题(能解决有更多分)

lnasp 2003-10-16 12:27:33
id name age
1 a 10
2 b 11
3 c 10
4 d 9
5 e 8
6 f 10
统计count(id for all)可以统计一共有多少人。
我要统计age=10的有多少人怎么办??
...全文
17 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
佣工7001 2003-10-17
  • 打赏
  • 举报
回复
如果数据在datawindow中,在脚本中可以直接使用如下函数
long(describe("evaluate('sum (if ( age = 10, 1, 0)',1)"))
yjhyn 2003-10-17
  • 打赏
  • 举报
回复
如今,我还能说什么呢……
我话可说了!!!







学习中ing
zzr72 2003-10-17
  • 打赏
  • 举报
回复
select count(id) into :argument from table_name where age = 10
count( if ( age = 10, 1, 0) for all)
两种用法,总有一种适合你吧
eminena 2003-10-17
  • 打赏
  • 举报
回复
添加计算域 CP_1,表达式为
count( if ( age = 10, 1, 0) for all)
klbt 2003-10-16
  • 打赏
  • 举报
回复
sorry,应该是sum ( if ( age = 10, 1, 0) for all)
klbt 2003-10-16
  • 打赏
  • 举报
回复
是在数据窗口中吗?
用计算域:sum ( if ( id = '10', 1, 0) for all)
rogery 2003-10-16
  • 打赏
  • 举报
回复
int li_row
select count(*) into :li_row from tablename where are = 10 ;
wantsong 2003-10-16
  • 打赏
  • 举报
回复
上面是在datawindow得计算列写
也可以在retrieveend事件中循环统计,再写入dw标签
wantsong 2003-10-16
  • 打赏
  • 举报
回复
if (age = 10,count(id),0)
纳米茶 2003-10-16
  • 打赏
  • 举报
回复
select distinct count(id) from tablename where age = 10;
freeliu 2003-10-16
  • 打赏
  • 举报
回复
select count(id) from table_name where age = 10
liliang800207 2003-10-16
  • 打赏
  • 举报
回复
select count(id) from table_name where age = 10
flyhot 2003-10-16
  • 打赏
  • 举报
回复
up
longdrang 2003-10-16
  • 打赏
  • 举报
回复
同意
嘘嘘兔 2003-10-16
  • 打赏
  • 举报
回复
同意快乐白兔
ropriest 2003-10-16
  • 打赏
  • 举报
回复
数据窗口中计算列:sum ( if ( age = 10, 1, 0) for all)
workhand 2003-10-16
  • 打赏
  • 举报
回复
综合楼上两位高手的意见应该可以了

609

社区成员

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

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