数据库获取前N条记录SQL Server与SQLite的区别


在使用sql语句进行前20条记录查询时SQL Server可以这样写:

1: select top 20 * from [table] order by ids desc

2: select top 20 * from [table] where id not in (select top 20 id from [table] ) 

3: select top 20 * from (select top 30 * from [table] order by id) as tb1 order by tb1.id

而在SQLite中要这样用:

1:select * from [table] order by id  limit 20

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM