sqlite3 top的查询及limit语法介绍

sqlite3 top的查询及limit语法介绍,第1张

sqlite3 top的查询及limit语法介绍 其实,在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;

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/sjk/888577.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-14
下一篇 2022-05-14

发表评论

登录后才能评论

评论列表(0条)

保存