select identity(int,1,1) as col_id,* into temp from 表select * from temp where col_id between 50 and 60
select top 60 * from 表名 where 主键 not in (select top 50 主键 from 表名)感觉这个查询速度可能慢了一点,不过效果可以达到。其他的方法网上应该还有很多
select top 60 * from 表名 where 主键 not in (select top 50 主键 from 表名)感觉这个查询速度可能慢了一点,不过效果可以达到。其他的方法网上应该还有很多-----------------------------------------------------------------------应该是 select top 10 * from 表名 where 主键 not in (select top 50 主键 from 表名)
-- step 3. select top 20 userid,nick,classid,writetime from t_userinfo where userid not in ( select top 900000 userid from t_userinfo order by userid asc )-- 耗时 8 秒 ,够长的-- step 4. select a.userid,b.nick,b.classid,b.writetime from ( select top 20 a.userid from ( select top 900020 userid from t_userinfo order by userid asc ) a order by a.userid desc ) a inner join t_userinfo b on a.userid = b.userid order by a.userid asc-- 耗时 1 秒,太快了吧,不可以思议不要用not in,效率太低了,看看这个地方吧http://community.csdn.net/Expert/TopicView.asp?id=5619808
select top 10 * from (Select top 60 * from tablename order by ID asc) a order by ID desc
select top 10 * from 表名 where 主键 not in (select top 50 主键 from 表名)
select top 20 userid,nick,classid,writetime from t_userinfo
where userid not in
(
select top 900000 userid from t_userinfo order by userid asc
)-- 耗时 8 秒 ,够长的-- step 4.
select a.userid,b.nick,b.classid,b.writetime from
(
select top 20 a.userid from
(
select top 900020 userid from t_userinfo order by userid asc
) a order by a.userid desc
) a inner join t_userinfo b on a.userid = b.userid
order by a.userid asc-- 耗时 1 秒,太快了吧,不可以思议不要用not in,效率太低了,看看这个地方吧http://community.csdn.net/Expert/TopicView.asp?id=5619808