sql 分组根据每组内部排序后的每组连续唯一的顺序编号

select row_number() over (partition by 分组字段 order by 排序字段) as 序号,表现出的是组内连续不唯一的序号,

 

select * from (select row_number() over (order by  排序字段 desc) as rowid from table) as table where rowid between (@PageIndex-1)*@PageSize+1 and @PageIndex*@PageSize 分页查询,可用于中小数据排序,

posted @ 2015-11-10 11:02  木子无音  阅读(524)  评论(0编辑  收藏  举报