用count()怎么统计表中的记录总数,请给个例子

解决方案 »

  1.   

    select count(*) from table where ...
      

  2.   

    Select count(*) from 表 
    select count(1) from 表   -- 与上一语句同样效果,但速度会快一点
    select count(distinct 字段1) from 表  -- 只统计字段1不重复的记录数。
      

  3.   

    或者用recordset.recordcount也可以。
      

  4.   

    Select count(*) from tbTable --可以直接统计记录条数
    Select count(*) from tbTable Where 条件 --可以在Where后写上自己的条件,统计满足条件的数目。
    select count(Key) from tbTable   -- 你在设计标结构时,最好有一个主键如:Key,这样你的查询效率将提高。