SQL 新发现的东东
新建表变量
declare @indextable table(id int identity(1,1), nid int)
insert @indextable
select 2
union
select 3
select * from @indextable
declare @indextable table(id int identity(1,1),nid int)
set rowcount @endIndex
insert into @indextable(nid) select ID from News order by ID desc
select * from News O,@indextable t where O.ID=t.nid
and t.id between @startIndex and @endIndex order by t.id