sqlserver2008从一个表中模糊查询并分页

2025-05-08 00:01:55
推荐回答(3个)
回答(1):

select * from (
select * from(
select b.*,rownum rn from bbs b where title like '%呵呵%'
and rownum<=10)
where rn<=分页的上限)
where rn>分页的下限

回答(2):

加个条件:where rownum <= 10

select * from bbs where title like '%呵呵%'
and rownum <= 10;

回答(3):

select top 10 * from bbs where title like '%呵呵%'