create procedure sp_pageing_abc @cur_page_num int, -- 当前页码 @page_size int -- 页码大小 传值时,这里填10 as begin select top @page_size * from abc where id<=(select isnull(min(id),0) from ( select top(@page_size*(1-1)) id from abc where is_borrow=1 order by id desc ) as t) and is_borrow=1 order by id desc end -- 说明: 如果你不想加是否被借阅过的条件,则把where子句的条件去掉即可,但order by id desc得要保留。否则不能得到正确的结果。
时间: 2024-12-11 23:16:05