MySQL分页limit的使用方法
来源:互联网 发布:盐城办公软件培训 编辑:程序博客网 时间:2024/05/18 03:31
select * from table limit 0,10
上面句子中,0是起始offset,10是select出来的record数目,整句的意思是,选择table中前十条
当然也可以直接写成
select * from table limit 10
如果换个offset
select * from table limit 5,10
这句的意思是,返回第6至15行record,虽然语句中第一个参数写的是5,但是实际上,是从offset+1开始,也就是6,所以是第6行开始,包括第六行,总共10条,也就是去到第15条record
如果table数目特别多,需要跳转到后面第几十页的话,例如下面这个例子,每页20个,查看第501页
select * from table where id>=10000 order by id asc limit 0,20
前1页
select * from table where id < 10000 order by id asc limit 0,20
select * from table where id < 10000 order by id asc limit 20,20
后1页
select * from table where id >= 10000 order by id asc limit 20,20
0 0
- MySQL分页limit的使用方法
- mysql 分页用的limit
- mysql分页的sql的limit
- mysql limit 分页语句的优化
- MySQL的LIMIT与分页优化
- MySQL limit用法,分页的实现。
- Mysql中limit分页的用法
- mysql limit使用方法
- Mysql中的LIMIT使用方法
- asp+mysql limit分页
- mysql limit 分页
- mysql分页limit优化
- mysql limit实现"分页"
- MySQL 优化Limit分页
- mysql limit 分页
- mysql limit逻辑分页
- mybatis mysql limit 分页
- mysql分页limit 优化
- 005Longest Palindromic Substring
- hdu 1281 棋盘游戏(二分图匹配)
- BindService的用法
- Android 手势监听学习总结
- C++名字空间详解
- MySQL分页limit的使用方法
- First Blood.
- JS+AJAX(.ASHX) 实现用户登录
- Follow your heart
- hdu 5389 Zero Escape(dp类似背包)
- Candy
- UVa 821- Page Hopping(Floyd)
- Linux sed 命令
- 赋值和属性变量下划线