表结构:
  ID     NAME      TestTime      Address
     
    1      kill      2003-11-29    香港
  2   killrem   2003-11-29    北京
  3   killghost 2003-11-29    成都
  4   kill123   2003-11-30    广州
  5   kill124  2003-11-30    上海 如何有效的查询出下面的这个结果来??
  TestTime      count
    2000-11-29     3
    2003-11-30     2      

解决方案 »

  1.   

    我使用的是: select distinct Testtime from tablename,但是只能查询出    TestTime      
        2000-11-29    
        2003-11-30     
      

  2.   

    select count(id) as count  from tablename group by TestTime
      

  3.   

    应该是按日期进行分组,你看看SQL关于Select的详细帮助,记得里面有。
      

  4.   

    sorry,掉了个TestTime
    select count(id) as count,testtime  from tablename group by TestTime
      

  5.   

    select testtime,count(testtime) as count_temp from tablename group by testtime
      

  6.   

    noil0125(珏心) :在Group by 中能否使用多个变量??例如:
    select count(id) as count  from tablename group by TestTime ,name
      

  7.   

    SELECT 日期, COUNT(*) AS Count
    FROM Client
    GROUP BY 日期
    这样就可以了