sqlite3 top的查詢及limit文法介紹

來源:互聯網
上載者:User

其實,在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;

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.