Select distinct count(*) from t1
 

解决方案 »

  1.   

    select count(*) from t1 group by xm
    不对呀!
    请关注!
      

  2.   

    Select  count(distinct xm) from t1
      

  3.   

    select count(xm) from t1 group by xm
      

  4.   

    一句话搞定:
    select count(distinct xm) from table1
      

  5.   

     caoyq:
    select count(distinct xm) from table1
    提示语法有错误
    谢谢,请继续
      

  6.   

    select count(xm) from (select distinct xm from table1)
      

  7.   

    不可能!你用的是什么数据库?
    这句话我是在SQL SERVER7下验证了的。
      

  8.   

    Bob7946(X度空间):
    你写的 
    select count(xm) from (select distinct xm from table1)  
    在SQL SERVER7 下通不过。
      

  9.   

    yzqb(阿波):“提示语法有错误”。请给出错误提示。
      

  10.   

    Bob7946(X度空间)  好象是对的,我再试试!
      

  11.   

    sorry,错了,应该是:
    select count(xm) from table where xm in (select distinct xm from table1)  
      

  12.   

    Bob7946(X度空间):
    老弟,你分析分析,这样把table1的记录就全取出来了!跟select count(xm) from table1有什么区别呢?
      

  13.   

    yzqb(阿波):
    你后台用的是什么数据库呀?
    你不给出错误提示,我怎么帮你解决问题呀?
      

  14.   

    我试了一下,应该是
    select count(distinct xm) from table1
      

  15.   

    select xm,count(*) from table group by xm
      

  16.   

    Select Count(xm) From (Select Disinct xm From Table)
    不知道会不会简单点。
      

  17.   

    注解:
    Select distinct Count(xm) From t1 group by xm //可以得到每一个人出现的次数
    Select Count(distinct xm) From t1             //可以得到人数
      

  18.   

    Bob7946(X度空间) 
    select count(xm) from (select distinct xm from table1) 
    在access下完全通过 
    谢谢各位
    散分!!!!
      

  19.   

    caoyq(草民呆瓜)的说法在Paradox表上通过