sqliteテクニック

1507 ワード

SQLite  ID  
      INTEGER PRIMARY KEY AUTOINCREMENT
 :

CREATE   TABLE  21andy ( id  INTEGER   PRIMARY   KEY  AUTOINCREMENT, 21andy  VARCHAR ( 100 )  NOT   NULL , date DATE ); 
    AUTOINCREMENT,  MySQL      




SQLite   
SQLite  TRUNCATE     ,      

DELETE   FROM  21andy; 


 

SQLite      ,   ID 0 

    

DELETE   FROM  sqlite_sequence; 
   ,   sqlite_sequence  CRUD




SQLite      ,       
     

VACUUM 


SQLite      
     :

Select   *   From  Account Limit  9  Offset  10 ; 


SELECT   *   FROM  Account LIMIT  10 ,  9 
            ,             ,   10 ,     9   .


SQLite       
         SQLite            ,            ,                 ,        . SQLite        ,                .    :

BEGIN ;
CREATE   TABLE  t2(a  INTEGER , b  INTEGER , c  VARCHAR ( 100 ));
INSERT   INTO  t2  VALUES ( 1 , 59672 , ' fifty nine thousand six hundred seventy two ' );
INSERT   INTO  t2  VALUES ( 24999 , 89569 , ' eighty nine thousand five hundred sixty nine ' );
INSERT   INTO  t2  VALUES ( 25000 , 94666 , ' ninety four thousand six hundred sixty six ' );
COMMIT ;  
 SQLite                 ,          ,                   .            .


SQLite      INSERT,  UPDATE 
SQLite SQL   MySQL, SQLite         REPLACE,         :

 REPLACE   INTO   [ table ]  (row1, row2)  VALUES  ( 2 ,  3 ); 
         ,           ,           ,         .        ,                .

SQLite   ISNULL  
SQLite SQL      MySQL,     ISNULL,     IFNULL     


 ifnull(null,0)