SQL2000 以ID降序的方式查询出第600--1000条的语句怎么写啊!
发布网友
发布时间:2022-04-24 14:34
我来回答
共4个回答
热心网友
时间:2023-10-16 15:33
select top 399 * from tablename where id not in
(select top 599 id from tablename order by id desc)
order by id desc
算错了,应该是401条数据
select top 401 * from tablename where id not in
(select top 599 id from tablename order by id desc)
order by id desc
热心网友
时间:2023-10-16 15:33
select top 401 * from table
where not exists (select top 599 from table)
order Id desc
热心网友
时间:2023-10-16 15:34
select top 600 * from 表 order by id desc
热心网友
时间:2023-10-16 15:34
select top 400 * from tablename where id not in
(select top 599 id from tablename order by id desc)
order by id desc
你可以直接写一个分与的存储过程