select a.id,a.cntid,a.subject,a.previewfile,a.producetime,b.name
from a,b
where a.status=1
and a.cntid=b.id
and a.producetime in (select distinct producetime from a
                      where rownum<6
                      order by producetime desc)

解决方案 »

  1.   

    select * from (select a.id,a.cntid,a.subject,a.previewfile,a.producetime,b.name from a,b where A.cntid(+)=B.id and a.status='1' order by A.producetime desc) where rownum<=5
      

  2.   

    select * from (select a.id,a.cntid,a.subject,a.previewfile,a.producetime,b.name from a,b where a.status=1 and a.cntid=b.id and a.producetime) where rowid<(min(rowid)+5);
      

  3.   

    select a.id,a.cntid,a.subject,a.previewfile,a.producetime,b.name
    from a,b
    where a.status=1
    and a.cntid=b.id
    and a.producetime and rownum<6 order by A.producetime desc我这样与楼上写的怎么不一样啊....