日期:2014-05-17 浏览次数:20531 次
create procedure proc_GetListByPage1 @pageIndex int=1,@pageSize int=5 as select top @pageIndex * from employees where employeeid not in ( select top @pageSize*(@pageIndex-1) employeeid from employees order by employeeid asc )order by employeeid asc
alter procedure proc_GetListByPage1 @pageIndex int=1,@pageSize int=5 as select top (@pageIndex) * from employees where employeeid not in ( select top (@pageSize*(@pageIndex-1)) employeeid from employees order by employeeid asc )order by employeeid asc
------解决方案--------------------
top 要加上括号
create procedure proc_GetListByPage1 ( @pageIndex int=1, @pageSize int=5 ) as select top (@pageIndex) * from employees where employeeid not in ( select top ((@pageSize)*(@pageIndex-1) ) employeeid from employees order by employeeid asc ) order by employeeid asc
------解决方案--------------------
变量前后加括号
------解决方案--------------------
日,网卡,就差了4秒