请教一个sql语句(查询数据方面)
有张表大约有2万条数据   
 在查询分析器中我想用一个语句取出前一万条跟后一万条   
 该sql该怎么写   
 如果要查询中间的5千条记录呢?   又该如何写   
 谢谢了   
 在线等
------解决方案--------------------select top 10000 * from tbName order by ID    
 select top 10000 * from tbName order by ID desc   
------解决方案--------------------set rowcount 10000--不显示前10000   
 查询完后 
 set rowcount 0--设置还原   
 1楼的方法,定义排序后就已这是表的默认排序了..   
 最好是通过临时表 
 select *,id=identity(1,1)into #--递增列id 
  from 表     
 查询 
 select top 10000 * from #--前10000 
 select top 10000* from # where id not in(select top 10000 from #)后10000