您的位置:首页 > 数据库

分页Sql语句(2种常用的查询sql)

2016-07-04 22:27 330 查看
【当前页为 1】

直接 select top 10 *  from menus 

【当前页不为1】

select top 10 *  from menus  where   menuId >(select MAX(menuId) from (select top   30 menuId from menus order by menuId asc ) as TabTemp) order by menuId

================第二种查询方法==========================

select top 10 * from menus where menuId not in (select top 0 menuId from menus)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: