SQL优化[32]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 fly_miss 的 blog

(select   top '+cast((@recsperpage*(@page-1)) as varchar(20))+' '+@id+' from ('+@sql+') t9 order by '+@sort+') order by '+@sort

print @str

exec sp_executesql @str
go

其实,以上语句可以简化为:

select top 页大小 *

from table1

where (id not in

          (select top 页大小*页数 id

         from

本文关键:SQL优化
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top