日期:2014-05-17 浏览次数:20527 次
select * from ( select row_number() over(order by getdate()) rn,* from news) t where rn between 3 and 4
------解决方案--------------------
分库的话,这样
select * from [数据库名]..[表名]
如
--getdate()换为你的排序列,不知你有哪些列,所以我没换 select * from ( select row_number() over(order by getdate()) rn,* from [数据库名]..news) t where rn between 3 and 4
------解决方案--------------------
个人建议 分页还是用临时表吧!你top的话 数据太多了会有点小问题
with tableName (column1,column2,.....)
as
(select Row_Nmber() over(order by aa desc) c1,c2,..... +)
select * from TableName + where ....
------解决方案--------------------
order by newsid desc 放到下面例子的位置,看看
select * from ( select top 4 * from (select top 100 percent * from news) a order by newsid desc)b except select * from (select top 2 * from (select top 100 percent * from news) a order by newsid desc)c
------解决方案--------------------
SELECT 。。。 FROM ( SELECT ROW_NUMBER() OVER(ORDER BY newsid desc) AS RowNumber, 。。。。FROM news