虚位以待(AD)
虚位以待(AD)
首页 > 数据库 > SQLite数据库 > sqlite3 top的查询及limit语法介绍

sqlite3 top的查询及limit语法介绍
类别:SQLite数据库   作者:码皇   来源:互联网   点击:

sqlite3中没有top的语法结构,不过相关的语法能实现跟top语法相同的功能,感兴趣的你可以参考下,希望可以帮助到你
其实,在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 date desc,id limit 0,10;
相关热词搜索: sqlite3 top limit