本文整理自网络,侵删。
其实,在sqlite3中没有top的语法结构,但在sqlite3中有相关的语法能实现跟top语法相同的功能,sqlite3 sql是用limit这样的语法来实现的;如:
代码如下:
select * from table where name='_安静ゝ' order by id limit 0,10;
这个效果就相当于select top 10 * from table where name='_安静ゝ';
如果还有更精确的:
select * from table where name='_安静ゝ' order by id limit 0,10;
这个效果就相当于select top 10 * from table where name='_安静ゝ';
如果还有更精确的:
代码如下:
select * from table where name='_安静ゝ' order by date desc,id limit 0,10;
书籍
select * from table where name='_安静ゝ' order by date desc,id limit 0,10;
标签:SQLite
相关阅读 >>
使用sql语句统计数据时sum和count函数中使用if判断条件的讲解
更多相关阅读请进入《Sqlite》频道 >>

数据库系统概念 第6版
本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。