需要分页取记录,正在翻找以前的存储过程稍作改动,突然想起SqlServer2005 新增的TransactSql特性,赶紧搜索了一下,使用新的语法,大概如下
select * from (select row_number()over(order by city) as RowNumber, *
from person.address
) Address
where Address.rowNumber < 21 and Address.RowNumber > 10
新增加的row_number()很好用
posted @ 2006-4-1 23:50 by 河马