java吧 关注:1,297,740贴子:12,833,516
  • 2回复贴,共1

问:sqlserver两张同样结构的表union all查询之后怎么分页

只看楼主收藏回复

id都是自增长的


IP属地:江苏1楼2015-09-14 11:06回复
    大婶去哪啊


    IP属地:江苏2楼2015-09-14 11:08
    回复
      2026-02-19 08:48:07
      广告
      不感兴趣
      开通SVIP免广告
      select id,station_name,parent_id,root_id,img_count,station_addr
      from (select row_number() over(order by index_of) as row_num,a.*
      from xrongeap..tbl_sunroam_station a where a.root_id=1 and a.parent_id!=1and show_able=1 ) as b where b.row_num>"+startIndex+" and b.row_num<="+endIndex;
      这里的row_number() 只支持sqlserver2005以上的版本


      IP属地:湖北3楼2015-09-14 11:17
      回复