用SQL查询能查到从第200条到第500条的数据吗?
发布网友
发布时间:2024-05-07 23:36
我来回答
共4个回答
热心网友
时间:2024-11-20 11:24
可以,假设你的表主键是Id,表名是T
select *
from T
where id not in(
select top 200 Id
from T
order by Id)
and Id in(
select top 500 Id
from T
order by Id)
order by Id
热心网友
时间:2024-11-20 11:24
单纯的SQL不行,得嵌套在别的语言中才行。
热心网友
时间:2024-11-20 11:25
select top 300 *
from
(select top 500 *
from Table1
order by field1 )as zzz
order by field1
或者:select top 300 from Table where field1>all(select top 500 from Table boder by field1) order by field
或者:select top 300 from table where field1 not in (select top 500 from table order by filed) order by field
热心网友
时间:2024-11-20 11:26
可以先rank一下,在写条件