用sql语句呢?  本来表里就有时间字段 怎么用这个字段查 某段时间内 每条插入了多少条数据

解决方案 »

  1.   

    select count(*)
    from table
    where datediff(d,coldate,getdate()) = 0
      

  2.   

    怎么用这个字段查 某段时间内 每条插入了多少条数据
    ------------select count(*)
    from table
    where datediff(d,coldate,@startdate) >=0 
          and
          datediff(d,coldate,@enddate) <=0
      

  3.   

    可能我说的不详细吧举例 2.1--2.3 插入了10条数据 用sql查询 2.1插了几条 2.2插了几条 2.3插了几条sql怎么写的?
      

  4.   

    两种方法 
    1 触发器实现 性能可能不是很好
    2 增加插入时间列 td 做索引 
    select count(*) from table where datediff(d,td,getdate()) = 0
    td上不可能建主键 否则count性能要好些
      

  5.   

    不能通过一条sql分别查出那几天每天插入的数据量??