group by 的问题 select count(1) from card where sales>0 and client>0 group by client如果不要group by client可以得到结果但我想要不重复的数量 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 就是统计符合sales>0 and client>0的数目但重复的client只算一个 select count(distinct client) from card where sales>0 and client>0 --还是要select count(client) from card where sales>0 and client>0 select count(distinct client) from card where sales>0 and client>0 select count(distinct client) from card where sales>0 and client>0 意思是这样可会出错 [code=BatchFile]select count(1) from (select distinct client from card where sales>0 and client>0)[/code]这样实现了但应该有更好的方法吧 select count(distinct client) from card where sales>0 and client>0 这个会出错不知是不是access不支持呢语法错误 (操作符丢失) 在查询表达式 'count(distinct client)' 中。 关于SQL语句书写风格的疑问 如下查询语句如何优化 求助:Execute失败!错误信息:IDispatch error #3119 请教 安装SQL SP4的问题 请问怎么将SDF数据库转换成DBO数据库? 这个问题是不是要用的触发器? datetime问题,求大虾指教 Delphi开发数据库,发现SQL Server占用CPU98%的问题,求救! 这也是一个问题? sql数据库中如何把时间自字段加一分钟 统计汇总的存储过程 求助通过a列对应的b列数据循环更新b列NULL
但重复的client只算一个
--还是要
select count(client) from card where sales>0 and client>0
select count(distinct client) from card where sales>0 and client>0
意思是这样
可会出错
select count(1) from (select distinct client from card where sales>0 and client>0)
[/code]这样实现了
但应该有更好的方法吧
这个会出错
不知是不是access不支持呢
语法错误 (操作符丢失) 在查询表达式 'count(distinct client)' 中。