select count(*) from uis_md_stcustom where firsttime >= trunc(add_month(sysdate,-1),'mm') and firsttime < trunc(sysdate,'mm')
如果是从当前时间到前一个月的这个时候之间的记录总条数: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');
where firsttime >= trunc(add_month(sysdate,-1),'mm')
and firsttime < trunc(sysdate,'mm')
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');