多表联合查询分页问题

来源:互联网 发布:网络内蒙敬酒歌歌词 编辑:程序博客网 时间:2024/05/09 19:29

  

   查询记录的条数:
      select count(*) as ct from email t ,sys_member m where t.sendMan=m.id
       and t.reMan=#reMan#

  

  按条件进行分页查询
   

        select * from

          (

           select a.*,rownum as rno from

          (        

          select t.* ,m.mname from email t,sys_member m where   
        t.sendman=m.id and t.reMan=#reMan#
  order by t.id desc        
        )

        a where rownum<=#posTo#

      )

      b  where b.rno>=#posFrom#

    其中红色的为第一层,即联合查询层