sqlServer使用ROW

2019-08-22 19:53   | Post by:   | in 行业知识

设置sqlserver使用row_number时不排序

--1.看到nhibernate是这样写的分页,感觉写起来比较容易理解
--with只是定一个别名?

[sql]
with query as over) as rownum, * from product)
select * from query where rownum between 5 and 10

--2.row_number必须指写over ,有时我根本就不想排序,想按原始顺序

--方法就是:
select row_number over) as rownum,* from product

排序 就是 :
select row_number over as rownum,* from product
最新新闻