sqlite> select datetime('now');
  2004-01-05 17:23:58 -- correct day and time of day
  sqlite> select datetime('now', 'weekday 0');
  2004-01-11 00:00:00 -- correct day, lost time of day
  sqlite> select datetime('now', '1 month');
  2004-02-05 00:00:00 -- correct day, lost time of day
  sqlite> select datetime('now', '1 year');
  2005-01-05 00:00:00 -- correct day, lost time of day呵呵,正在研究。

解决方案 »

  1.   

    http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions这个应该解决问题了.
      

  2.   

    就是说datetime可以支持strtotime的参数格式?
      

  3.   

    在官方网站上找到的资料abs(X) Return the absolute value of argument X. 
    coalesce(X,Y,...) Return a copy of the first non-NULL argument. If all arguments are NULL then NULL is returned. There must be at least 2 arguments. 
     glob(X,Y) This function is used to implement the "X GLOB Y" syntax of SQLite. The sqlite3_create_function() interface can be used to override this function and thereby change the operation of the GLOB operator. 
    ifnull(X,Y) Return a copy of the first non-NULL argument. If both arguments are NULL then NULL is returned. This behaves the same as coalesce() above. 
    last_insert_rowid() Return the ROWID of the last row insert from this connection to the database. This is the same value that would be returned from the sqlite_last_insert_rowid() API function. 
    length(X) Return the string length of X in characters. If SQLite is configured to support UTF-8, then the number of UTF-8 characters is returned, not the number of bytes. 
     like(X,Y) This function is used to implement the "X LIKE Y" syntax of SQL. The sqlite_create_function() interface can be used to override this function and thereby change the operation of the LIKE operator. 
    lower(X) Return a copy of string X will all characters converted to lower case. The C library tolower() routine is used for the conversion, which means that this function might not work correctly on UTF-8 characters. 
    max(X,Y,...) Return the argument with the maximum value. Arguments may be strings in addition to numbers. The maximum value is determined by the usual sort order. Note that max() is a simple function when it has 2 or more arguments but converts to an aggregate function if given only a single argument. 
    min(X,Y,...) Return the argument with the minimum value. Arguments may be strings in addition to numbers. The minimum value is determined by the usual sort order. Note that min() is a simple function when it has 2 or more arguments but converts to an aggregate function if given only a single argument. 
    nullif(X,Y) Return the first argument if the arguments are different, otherwise return NULL. 
    quote(X) This routine returns a string which is the value of its argument suitable for inclusion into another SQL statement. Strings are surrounded by single-quotes with escapes on interior quotes as needed. BLOBs are encoded as hexadecimal literals. The current implementation of VACUUM uses this function. The function is also useful when writing triggers to implement undo/redo functionality.  
    random(*) Return a random integer between -2147483648 and +2147483647. 
    round(X)
    round(X,Y) Round off the number X to Y digits to the right of the decimal point. If the Y argument is omitted, 0 is assumed. 
    soundex(X) Compute the soundex encoding of the string X. The string "?000" is returned if the argument is NULL. This function is omitted from SQLite by default. It is only available the -DSQLITE_SOUNDEX=1 compiler option is used when SQLite is built. 
    sqlite_version(*) Return the version string for the SQLite library that is running. Example: "2.8.0" 
    substr(X,Y,Z) Return a substring of input string X that begins with the Y-th character and which is Z characters long. The left-most character of X is number 1. If Y is negative the the first character of the substring is found by counting from the right rather than the left. If SQLite is configured to support UTF-8, then characters indices refer to actual UTF-8 characters, not bytes. 
    typeof(X) Return the type of the expression X. The only return values are "null", "integer", "real", "text", and "blob". SQLite's type handling is explained in Datatypes in SQLite Version 3. 
    upper(X) Return a copy of input string X converted to all upper-case letters. The implementation of this function uses the C library routine toupper() which means it may not work correctly on UTF-8 strings. avg(X) Return the average value of all X within a group. 
    count(X)
    count(*) The first form return a count of the number of times that X is not NULL in a group. The second form (with no argument) returns the total number of rows in the group. 
    sum(X) Return the numeric sum of all values in the group. 
      

  4.   

    The strftime() function also takes a format string as its first argument. 支持strftime();select strftime('%Y-%m-%d', 'now');
      

  5.   

    呵呵,这玩意现在连本全面的手册都没有,资料都要到cvs里去找。
      

  6.   

    呵呵,下载了SQLite 3,感觉这个数据库系统比较弱,也许是了解不多的原因。手册都不全,好多东西找不到,郁闷
      

  7.   

    http://blog.csdn.net/ezdevelop/archive/2004/09/21/111666.aspx在PHP中,可以将所有的函数作为SQLite的函数来使用
    例如使用md5()
    SELECT php('md5', filename) from files
      

  8.   

    题外话
    SQLite没有show tables?show tables有时候用起来蛮方便的嘛...
      

  9.   

    没有!但SQLite有一张内部表——sqlite_master
    当select * from sqlite_master时就可得到全部表信息