sqlite3 top的查詢及l(fā)imit語法介紹
更新時間:2013年02月25日 08:53:21 作者:
sqlite3中沒有top的語法結構,不過相關的語法能實現(xiàn)跟top語法相同的功能,感興趣的你可以參考下,希望可以幫助到你
其實,在sqlite3中沒有top的語法結構,但在sqlite3中有相關的語法能實現(xiàn)跟top語法相同的功能,sqlite3 sql是用limit這樣的語法來實現(xiàn)的;
如:
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 id limit 0,10;
這個效果就相當于select top 10 * from table where name='_安靜ゝ';
如果還有更精確的:
復制代碼 代碼如下:
select * from table where name='_安靜ゝ' order by date desc,id limit 0,10;
相關文章
Sqlite數(shù)據(jù)庫里插入數(shù)據(jù)的條數(shù)上限是500
sqlite每次只能插入的數(shù)據(jù)不能超過500條數(shù)據(jù),大家在使用的時候需要注意一下。2015-04-04