永发信息网

ASP中如何统计布尔字段中值为true的个数?

答案:3  悬赏:80  手机版
解决时间 2021-02-07 13:14
  • 提问者网友:寂寞梧桐
  • 2021-02-06 19:54
表att中有一个字段(“kq”),其类型为布尔型。请问查询中如何统计该字段中值为true的个数?(即SQL语句如何写?)
最佳答案
  • 五星知识达人网友:持酒劝斜阳
  • 2021-02-06 21:20
select count(kq) as num from att where kq = true 然后response.write rs("num")
全部回答
  • 1楼网友:妄饮晩冬酒
  • 2021-02-06 23:29
select count(*) as count from att where kq =true count 是别名
  • 2楼网友:行路难
  • 2021-02-06 21:54
你好! rs.open "select count(*) from att where kq",conn,1,1 或 rs.open "select -sum(kq) from att",conn,1,1 rs(0)即为统计结果 我的回答你还满意吗~~
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯