sqlite3 top的查詢及l(fā)imit語法介紹
  更新時(shí)間:2013年02月25日 08:53:21   作者:   
                        sqlite3中沒有top的語法結(jié)構(gòu),不過相關(guān)的語法能實(shí)現(xiàn)跟top語法相同的功能,感興趣的你可以參考下,希望可以幫助到你
                        
                            其實(shí),在sqlite3中沒有top的語法結(jié)構(gòu),但在sqlite3中有相關(guān)的語法能實(shí)現(xiàn)跟top語法相同的功能,sqlite3 sql是用limit這樣的語法來實(shí)現(xiàn)的; 
如:
 
select * from table where name='_安靜ゝ' order by id limit 0,10;
 
這個(gè)效果就相當(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;
這個(gè)效果就相當(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教程(五):數(shù)據(jù)庫和事務(wù)
這篇文章主要介紹了SQLite教程(五):數(shù)據(jù)庫和事務(wù),本文講解了Attach數(shù)據(jù)庫、Detach數(shù)據(jù)庫、事務(wù)等內(nèi)容,需要的朋友可以參考下2015-05-05
 基于sqlite特殊字符轉(zhuǎn)義的實(shí)現(xiàn)方法
本篇文章是對sqlite特殊字符轉(zhuǎn)義的實(shí)現(xiàn)方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-05-05
 SQLite3中的日期時(shí)間函數(shù)使用小結(jié)
這篇文章主要介紹了SQLite3中的日期時(shí)間函數(shù)使用小結(jié),同時(shí)介紹了一些SQLite數(shù)據(jù)庫的基本知識,需要的朋友可以參考下2014-05-05
 Sqlite數(shù)據(jù)庫里插入數(shù)據(jù)的條數(shù)上限是500
sqlite每次只能插入的數(shù)據(jù)不能超過500條數(shù)據(jù),大家在使用的時(shí)候需要注意一下。2015-04-04

