select top 20 * from (select top 40 * from t1) order by id desc
t1因该是数据表,id是字段,order by desc是排序,对吧?
这就是分段查询嘛。 select top 20 * from tblname where KeyID not in (select top 20 KeyID from tblname order by KeyID ASC) order by KeyID ASC
1、select top 20 * from (select top 40 * from t1) order by id desc 2、select top 20 * from tblname where KeyID not in (select top 20 KeyID from tblname order by KeyID ASC) order by KeyID ASC第一句与第二句的效果是一样的吗?
select top 20 * from tblname where KeyID not in
(select top 20 KeyID from tblname order by KeyID ASC)
order by KeyID ASC
2、select top 20 * from tblname where KeyID not in
(select top 20 KeyID from tblname order by KeyID ASC)
order by KeyID ASC第一句与第二句的效果是一样的吗?