使用top和left join执行sqlserver2000分页的新思路
ofei 2007-03-01 12:45:44 或许有人发过类似的帖子,不过对我来说是第一次。
很多分页都都是使用top,not in, not exists,临时表,表变量
我刚想到的另一种方法如下:
use northwind;
select a.* from
(select top 60 * from products )a
left join
(select top 50 * from products) b
on b.productid = a.productid
where b.productid is null
这将会得到productid为51-60的纪录
暂且不讨论此语句的性能
不知道大家对此有什么看法?