select count(1) from card where sales>0 and client>0 group by client
如果不要group by client可以得到结果
但我想要不重复的数量

解决方案 »

  1.   

    就是统计符合sales>0 and client>0的数目
    但重复的client只算一个
      

  2.   

    select count(distinct client) from card where sales>0 and client>0 
    --还是要
    select count(client) from card where sales>0 and client>0 
      

  3.   


    select count(distinct client) from card where sales>0 and client>0 
      

  4.   

    select count(distinct client) from card where sales>0 and client>0 
    意思是这样
    可会出错
     
      

  5.   

    [code=BatchFile]
    select count(1) from (select distinct client from card where sales>0 and client>0)
    [/code]这样实现了
    但应该有更好的方法吧
      

  6.   

    select count(distinct client) from card where sales>0 and client>0 
    这个会出错
    不知是不是access不支持呢
    语法错误 (操作符丢失) 在查询表达式 'count(distinct client)' 中。