表biz
bizid number
bizname varchar2
表rec
recid number
bizid number
startdate date
enddate date
统计enddate大于startdate bizname="收件业务"的rid数量我写的select count(recid) from biz b,rec r where b.bizid=r.bizid and r.startdate<r.enddate;
不报错但查不到任何结果,那位高手大哥 知道怎么写?

解决方案 »

  1.   

    select  count(r.recid)   from   biz   b,rec   r   
    where   b.bizid = r.bizid   
    and     trunc(r.startdate) < trunc(r.enddate)
    and     b.bizname="收件业务"; 你试下上面的语句,看行不?
      

  2.   

    select count(*) from biz b,rec r where b.bizid=r.bizid and r.startdate <r.enddate and bizname='收件业务'