最新评论
Gary Gong 2009-02-12 15:55
1.写sql语句查出表A中第31到第40条记录(id为自动增长列但不一定连续);
select top(40-31+1) * from table not in (select top(31-1) * from table)
用not in 似乎不太好吧.
我的算法是
select top 10 * from A
where id in
(select top 40 id from A
order by id DESC)
select top(40-31+1) * from table not in (select top(31-1) * from table)
用not in 似乎不太好吧.
我的算法是
select top 10 * from A
where id in
(select top 40 id from A
order by id DESC)


