会的来帮个忙..谢谢咯..

解决方案 »

  1.   

    哪位高手来帮帮忙呀...表名为uis_md_stcustom 时间字段为firsttime怎么样用当前时间开始查找出前一个月的记录总条数?
      

  2.   

    select count(*) from uis_md_stcustom
    where firsttime >= trunc(add_month(sysdate,-1),'mm')
          and firsttime < trunc(sysdate,'mm')
      

  3.   

    如果是从当前时间到前一个月的这个时候之间的记录总条数:select count(1)
      from uis_md_stcustom u
     where firsttime between add_months(sysdate,-1) and sysdate;如果是求当前时间的前面一个月的内的记录总条数:select count(1)
      from uis_md_stcustom u
     where to_char(firsttime,'mm') = to_char(add_months(sysdate,-1),'mm');
      

  4.   

    谢谢高手chenqingyu和mantisXF的帮忙.问题解决了!