日期:2014-05-19  浏览次数:20616 次

关于提取数据的问题
我想在一个表中     取出   第10条   到   第20条的记录   怎么取   谢谢大家   解决马上   结贴

------解决方案--------------------
假設ID為主鍵


Select TOP 10 * from TableName
Where ID Not In (Select TOP 10 ID from TableName Order By ID) Order By ID
------解决方案--------------------
Or

Select TOP 10 * From
(Select TOP 20 * From TableName Order By ID) A
Order By ID Desc
------解决方案--------------------
10-20应该是11条记录吧。。。
Select TOP 11 *
from TableName
Where ID In (Select TOP 20 ID from TableName Order By ID)
Order By ID Desc
------解决方案--------------------
或者:

Select TOP 11 *
from TableName
Where ID Not In (Select TOP 9 ID from TableName Order By ID)
Order By ID