Sqlite LIMIT / OFFSET的疑问
来源:互联网 发布:mac dashboard 关闭 编辑:程序博客网 时间:2024/05/20 13:18
问:
I have simple question with Sqlite. What is the difference between this:
Select * from Animals LIMIT 100 OFFSET 50
and
Select * from Animals LIMIT 100,50
答:
The two syntax forms are a little confusing because they reverse the numbers:
LIMIT <skip>, <count>
Is equivalent to:
LIMIT <count> OFFSET <skip>
It's compatible with the syntax from MySQL and PostgreSQL. MySQL supports both syntax forms, and its docs claim that the second syntax with OFFSET was meant to provide compatibility with PostgreSQL. PostgreSQL docs show it only supports the second syntax.
By the way, using LIMIT without first using ORDER BY may not always give you the results you intend. In practice, SQLite will return the rows in some order, probably determined by how they're physically stored in the file. But this doesn't necessarily mean it's in the order you want. The only way to get a predictable order is to use ORDER BY explicitly.
- Sqlite LIMIT / OFFSET的疑问
- LIMIT * OFFSET *的用法
- 优化mysql 的 limit offset
- 优化mysql的limit offset
- limit offset
- MySQL的limit和offset优化
- MySQL的limit和offset优化
- 如何优化LIMIT,OFFSET进行的分页?
- Mysql的limit和offset 区别
- 数据库中LIMIT和 OFFSET的理解
- mystl的limit与offset举例
- SQLite的limit用法
- SQLite的limit用法
- sqlite的limit使用
- sqlite的limit用法
- sqlite 的 limit
- sql 中 limit 与 limit,offset连用的区别
- sql 中 limit 与 limit,offset连用的区别
- JS日历控件 (兼容IE firefox) 可选择时间
- NM_CUSTOMEDRAW,WM_DRAWITEM和DrawItem()的讨论
- vmware下给linux添加硬盘
- 利用TOAD实现EXCEL数据在oracle的导入导出
- 当爱画上无休止的省略号,谁该给谁彼此自由,谁又该怪谁没有将彼此挽留
- Sqlite LIMIT / OFFSET的疑问
- 一起来学OpenMP(3)——for循环并行化基本用法
- 再再论指针----篇首语
- UITextField 的常用总结
- 巴菲特给子女的忠告之一
- 一起来学OpenMP(4)——数据的共享与私有化
- 一起来学OpenMP(5)——有效的数据规约
- 2.6.22.6版本的主目录下的Makefile 语法分析
- http://dict.wbw.com.cn 英语词汇网-速记手册