多表联合查询分页问题

  

   查询记录的条数:
      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#

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

你可能感兴趣的:(多表联合查询分页问题)