一个表tabalename里有几百条数据
我知道select top 5 * from tablename可以查询出前5行数据
我想查询出指定某行
如,第5行
请问应该怎么写语句?
1.
select top 1 *
from tablename
where ids not in(select top 4 ids from tablename)
ids是表里面的主键,或者是唯一字段
2.
还有一种方法是创建临时表解决
select identity(int,1,1) F0 ,* into #temp from tablename
select * from #temp where F0=5
drop table #temp