sqlite3 top的查詢及l(fā)imit語法介紹
更新時間:2013年02月25日 08:53:21 作者:
sqlite3中沒有top的語法結(jié)構(gòu),不過相關(guān)的語法能實現(xiàn)跟top語法相同的功能,感興趣的你可以參考下,希望可以幫助到你
其實,在sqlite3中沒有top的語法結(jié)構(gòu),但在sqlite3中有相關(guān)的語法能實現(xiàn)跟top語法相同的功能,sqlite3 sql是用limit這樣的語法來實現(xiàn)的;
如:
select * from table where name='_安靜ゝ' order by id limit 0,10;
這個效果就相當(dāng)于select top 10 * from table where name='_安靜ゝ';
如果還有更精確的:
select * from table where name='_安靜ゝ' order by date desc,id limit 0,10;
如:
復(fù)制代碼 代碼如下:
select * from table where name='_安靜ゝ' order by id limit 0,10;
這個效果就相當(dāng)于select top 10 * from table where name='_安靜ゝ';
如果還有更精確的:
復(fù)制代碼 代碼如下:
select * from table where name='_安靜ゝ' order by date desc,id limit 0,10;
相關(guān)文章
基于sqlite特殊字符轉(zhuǎn)義的實現(xiàn)方法
本篇文章是對sqlite特殊字符轉(zhuǎn)義的實現(xiàn)方法進行了詳細的分析介紹,需要的朋友參考下2013-05-05
保護你的Sqlite數(shù)據(jù)庫(SQLite數(shù)據(jù)庫安全秘籍)
相信使用PHP開發(fā)的人員一定不會對SQLite感到陌生了,PHP5已經(jīng)集成了這個輕量型的數(shù)據(jù)庫。并且很多虛擬主機無論是win還是*nux都支持它。2011-08-08

