新增函数row_number() :依照群组显示每条记录在该群组中出现的顺序位置,在显示每条记录编号时非常有用,并且搭配OVER子句。

create Proc fy @iRowCount INT,@iPageNo INT
as

select * from  (
select row_number() over (order by xm) row,xm from table1 ) table1
where row between @iRowCount*(@iPageNo-1)+1 and @iRowCount*@iPageNo
order by xm

go

exec fy 5,2

相关文章:

  • 2021-04-29
  • 2021-06-28
  • 2021-05-22
猜你喜欢
  • 2022-02-05
  • 2022-03-04
  • 2021-12-01
  • 2021-12-13
  • 2022-12-23
  • 2021-10-28
相关资源
相似解决方案